]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Compiling/Test.hs
Add Compiling.Sequences.
[haskell/symantic.git] / Language / Symantic / Compiling / Test.hs
1 {-# LANGUAGE NoMonomorphismRestriction #-}
2 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
3 module Compiling.Test where
4
5 import Test.Tasty
6
7 import qualified Compiling.Bool.Test as Bool
8 import qualified Compiling.Functor.Test as Functor
9 import qualified Compiling.Applicative.Test as Applicative
10 import qualified Compiling.Foldable.Test as Foldable
11 import qualified Compiling.Map.Test as Map
12 import qualified Compiling.MonoFunctor.Test as MonoFunctor
13
14 import Prelude hiding ((&&), not, (||), (==), id)
15
16 import Language.Symantic.Compiling
17
18 -- * Terms
19 te1 = lam $ \x -> lam $ \y -> (x || y) && not (x && y)
20 te2 = lam $ \x -> lam $ \y -> (x && not y) || (not x && y)
21 te3 = let_ (bool True) $ \x -> x && x
22 te4 = let_ (lam $ \x -> x && x) $ \f -> f .$ bool True
23 te5 = lam $ \x0 -> lam $ \x1 -> x0 && x1
24 te6 = let_ (bool True) id && bool False
25 te7 = lam $ \f -> (f .$ bool True) && bool True
26 te8 = lam $ \f -> f .$ (bool True && bool True)
27
28 -- * Tests
29 tests :: TestTree
30 tests = testGroup "Compiling" $
31 [ Bool.tests
32 , Functor.tests
33 , Applicative.tests
34 , Foldable.tests
35 , Map.tests
36 , MonoFunctor.tests
37 ]