1 {-# LANGUAGE FlexibleContexts #-}
2 {-# LANGUAGE NoImplicitPrelude #-}
3 {-# LANGUAGE NoMonomorphismRestriction #-}
4 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
5 {-# OPTIONS_GHC -fno-warn-tabs #-}
7 module Expr.Fun.Test where
9 import Data.Bool (Bool(..))
10 import Data.Function (($), id)
12 import Hcompta.Expr.Lit
13 import Hcompta.Expr.Bool
14 import Hcompta.Expr.Fun
16 e1 = val $ \x -> val $ \y -> (x `or` y) `and` neg (x `and` y)
17 e2 = val $ \x -> val $ \y -> (x `and` neg y) `or` (neg x `and` y)
18 e3 = let_val (lit True) $ \x -> x `and` x
19 e4 = let_val (val $ \x -> x `and` x) $ \f -> f `app` lit True
20 e5 = val $ \x0 -> val $ \x1 -> x0 `and` x1
21 e6 = let_val (lit True) id `and` lit False
22 e7 = val $ \f -> and (f `app` lit True) (lit False)
23 e8 = val $ \f -> f `app` and (lit True) (lit False)