import Data.List
gcd' x y = maximum $ (allDivisorsOf x) `intersect` (allDivisorsOf y)
where allDivisorsOf x = [ d | d < - [1..x], x `rem` d == 0 ]
Categories
import Data.List
gcd' x y = maximum $ (allDivisorsOf x) `intersect` (allDivisorsOf y)
where allDivisorsOf x = [ d | d < - [1..x], x `rem` d == 0 ]