{-# LANGUAGE DataKinds #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} module Compiling.Applicative.Test where import Test.Tasty import Data.Proxy (Proxy(..)) import Language.Symantic.Typing import Language.Symantic.Compiling import Compiling.Term.Test -- * Tests type Ifaces = [ Proxy (->) , Proxy Bool , Proxy Maybe , Proxy Applicative ] (==>) = test_term_from (Proxy::Proxy Ifaces) tests :: TestTree tests = testGroup "Applicative" [ Syntax "<*>" [ syJust [Syntax "xor" [syTrue]] , syJust [syTrue] ] ==> Right (tyMaybe :$ tyBool, Just False, "(\\x0 -> Just ((\\x1 -> (\\x2 -> x1 `xor` x2)) True) <*> x0) (Just True)") , Syntax "*>" [ syJust [syFalse] , syJust [syTrue] ] ==> Right (tyMaybe :$ tyBool, Just True, "Just False *> Just True") , Syntax "<*" [ syJust [syFalse] , syJust [syTrue] ] ==> Right (tyMaybe :$ tyBool, Just False, "Just False <* Just True") ]