arith013.hs 339 Bytes
Newer Older
Ian Lynagh's avatar
Ian Lynagh committed
1
-- Test gcd
2
3
4

main :: IO ()
main = do
Ian Lynagh's avatar
Ian Lynagh committed
5
6
   test gcd ([                       -42, 0, 105             ] :: [Int])
   test gcd ([-12193263111263526900, -42, 0, 105, 1234567890 ] :: [Integer])
7
8


9
test :: (Show a, Integral a) => (a -> a -> a) -> [a] -> IO ()
10
test f xs = mapM_ print [ (a, b, f a b) | a <- xs, b <- reverse xs, a /= 0  || b /= 0 ]