]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Compiling/Test.hs
Add Compiling, Interpreting and Transforming.
[haskell/symantic.git] / Language / Symantic / Compiling / Test.hs
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
11
12 import Test.Tasty
13 -- import Test.Tasty.HUnit
14
15 import qualified Compiling.Bool.Test as Bool
16
17 -- import Data.Maybe (isJust)
18 -- import Data.Proxy
19 -- import GHC.Prim (Constraint)
20 import Prelude hiding ((&&), not, (||), (==), id)
21
22 import Language.Symantic.Compiling
23
24 tests :: TestTree
25 tests = testGroup "Compiling" $
26 [ Bool.tests
27 ]
28
29
30 -- * Terms
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)