1 {-# LANGUAGE FlexibleContexts #-}
2 {-# LANGUAGE NoImplicitPrelude #-}
3 {-# LANGUAGE NoMonomorphismRestriction #-}
4 {-# LANGUAGE OverloadedStrings #-}
5 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
6 {-# OPTIONS_GHC -fno-warn-tabs #-}
8 module Expr.Bool.Test where
10 import Data.Bool (Bool(..))
11 import Data.Function (($))
13 import Hcompta.Expr.Lit
14 import Hcompta.Expr.Bool
15 import Hcompta.Expr.Trans
16 import Hcompta.Trans.Bool.Const
19 e1 = lit True `and` lit False
20 e2 = (lit True `and` lit False) `or` (lit True `and` lit True)
21 e3 = (lit True `or` lit False) `and` (lit True `or` lit True)
22 e4 = lit True `and` neg (lit False)
23 e5 = lit True `and` neg x
25 e7 = (x `xor` y) `xor` z
26 e8 = x `xor` (y `xor` lit True)
28 -- * Class 'Expr_Bool_Vars'
30 -- | A few boolean variables.
31 class Expr_Bool_Vars repr where
35 instance -- Trans_Boo_Const
38 ) => Expr_Bool_Vars (Trans_Bool_Const repr) where
42 instance Expr_Bool_Vars Repr_Text_Write where
43 x = Repr_Text_Write $ \_p _v -> "x"
44 y = Repr_Text_Write $ \_p _v -> "y"
45 z = Repr_Text_Write $ \_p _v -> "z"