1 {-# LANGUAGE DataKinds #-}
2 {-# LANGUAGE NoMonomorphismRestriction #-}
3 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
4 {-# OPTIONS_GHC -O0 #-} -- speedup compile-time…
5 module Compiling.MonoFunctor.Test where
9 import qualified Data.MonoTraversable as MT
10 import Data.Proxy (Proxy(..))
11 import Data.Text (Text)
12 import Prelude hiding (zipWith)
14 import Language.Symantic.Typing
15 import Language.Symantic.Compiling
16 import Compiling.Term.Test
25 , Proxy MT.MonoFunctor
28 (==>) = test_term_from (Proxy::Proxy Ifaces)
31 tests = testGroup "MonoFunctor"
33 [ syLam (Syntax "x" []) syBool
34 (Syntax "not" [Syntax "x" []])
36 ] ==> Right (tyMaybe :$ tyBool, Just False, "omap (\\x0 -> (\\x1 -> not x1) x0) (Just True)")
38 [ syLam (Syntax "x" []) syChar
39 (Syntax "Char.toUpper" [Syntax "x" []])
40 , Syntax "text" [Syntax "\"abc\"" []]
41 ] ==> Right (tyText, "ABC", "omap (\\x0 -> (\\x1 -> Char.toUpper x1) x0) \"abc\"")