euclid\'s algorithm in haskell