shithub: MicroHs

ref: 0a6f76bc5c3e2d48b503734bc7ea7ed39292d182
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 ]