shithub: MicroHs

ref: b2c417daf11c7b5e6c369e6e4b36fb35cc18eae1
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 ]