shithub: MicroHs

ref: e2ca4b93e4deb4d3c390caf5de467430925dffa3
dir: /tests/Arith.hs/

View raw version
module Arith(module Arith) where
import Prelude

vals :: [Int]
vals = [-5, -2, -1, 0, 1, 2, 5]

main :: IO ()
main = do
  putStrLn $ show [ op x y | x <- vals, y <- vals, op <- [(+),( - ),(*)] ]
  putStrLn $ show [ op x y | x <- vals, y <- vals, y /= 0, op <- [quot, rem] ]
  putStrLn $ show [ op x y | x <- vals, y <- vals, op <- [(==),(/=),(<),(<=),(>),(>=)] ]
  putStrLn $ show [ op x y | x <- vals, y <- vals, let op = compare ]