-- http://www.codewars.com/kata/5500d54c2ebe0a8e8a0003fd
module Codewars.Kata.GCD where
import Prelude hiding (gcd, lcm)

gcd :: Integral n => n -> n -> n
gcd = curry (fst . head . dropWhile ((/=0) . snd) . iterate (\(a, b) -> (b, a `mod` b)))
