]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Compiling/Test.hs
Fix lambda application.
[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
11 import Prelude hiding ((&&), not, (||), (==), id)
12
13 import Language.Symantic.Compiling
14
15 -- * Terms
16 te1 = lam $ \x -> lam $ \y -> (x || y) && not (x && y)
17 te2 = lam $ \x -> lam $ \y -> (x && not y) || (not x && y)
18 te3 = let_ (bool True) $ \x -> x && x
19 te4 = let_ (lam $ \x -> x && x) $ \f -> f .$ bool True
20 te5 = lam $ \x0 -> lam $ \x1 -> x0 && x1
21 te6 = let_ (bool True) id && bool False
22 te7 = lam $ \f -> (f .$ bool True) && bool True
23 te8 = lam $ \f -> f .$ (bool True && bool True)
24
25 -- * Tests
26 tests :: TestTree
27 tests = testGroup "Compiling" $
28 [ Bool.tests
29 , Functor.tests
30 , Applicative.tests
31 ]