1 {-# LANGUAGE DataKinds #-}
2 {-# LANGUAGE FlexibleContexts #-}
3 -- {-# LANGUAGE KindSignatures #-}
4 {-# LANGUAGE Rank2Types #-}
5 {-# LANGUAGE ScopedTypeVariables #-}
6 {-# LANGUAGE NoOverloadedStrings #-}
7 {-# LANGUAGE NoMonomorphismRestriction #-}
8 {-# LANGUAGE TypeOperators #-}
9 {-# OPTIONS_GHC -fno-warn-orphans #-}
10 module Compiling.Test where
13 -- import Test.Tasty.HUnit
15 import qualified Compiling.Bool.Test as Bool
17 -- import Data.Maybe (isJust)
19 -- import GHC.Prim (Constraint)
20 import Prelude hiding ((&&), not, (||), (==), id)
22 import Language.Symantic.Compiling
25 tests = testGroup "Compiling" $
31 te1 = lam $ \x -> lam $ \y -> (x || y) && not (x && y)
32 te2 = lam $ \x -> lam $ \y -> (x && not y) || (not x && y)
33 te3 = let_ (bool True) $ \x -> x && x
34 te4 = let_ (lam $ \x -> x && x) $ \f -> f .$ bool True
35 te5 = lam $ \x0 -> lam $ \x1 -> x0 && x1
36 te6 = let_ (bool True) id && bool False
37 te7 = lam $ \f -> (f .$ bool True) && bool True
38 te8 = lam $ \f -> f .$ (bool True && bool True)