{-# LANGUAGE NoMonomorphismRestriction #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} module Compiling.Test where import Test.Tasty import Language.Symantic.Compiling import qualified Compiling.Applicative.Test as Applicative import qualified Compiling.Bool.Test as Bool import qualified Compiling.Foldable.Test as Foldable import qualified Compiling.Functor.Test as Functor import qualified Compiling.Map.Test as Map import qualified Compiling.MonoFunctor.Test as MonoFunctor import qualified Compiling.Num.Test as Num import qualified Compiling.Tuple2.Test as Tuple2 import Prelude hiding ((&&), not, (||), (==), id) -- * Tests tests :: TestTree tests = testGroup "Compiling" $ [ Applicative.tests , Bool.tests , Foldable.tests , Functor.tests , Map.tests , MonoFunctor.tests , Num.tests , Tuple2.tests ] -- * EDSL tests te1 = lam $ \x -> lam $ \y -> (x || y) && not (x && y) te2 = lam $ \x -> lam $ \y -> (x && not y) || (not x && y) te3 = let_ (bool True) $ \x -> x && x te4 = let_ (lam $ \x -> x && x) $ \f -> f .$ bool True te5 = lam $ \x0 -> lam $ \x1 -> x0 && x1 te6 = let_ (bool True) id && bool False te7 = lam $ \f -> (f .$ bool True) && bool True te8 = lam $ \f -> f .$ (bool True && bool True)