]> Git — Sourcephile - haskell/symantic.git/blob - symantic-lib/Language/Symantic/Lib/MonoFunctor/Test.hs
Add withContext.
[haskell/symantic.git] / symantic-lib / Language / Symantic / Lib / MonoFunctor / Test.hs
1 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
2 module Lib.MonoFunctor.Test where
3
4 import Test.Tasty
5
6 import qualified Data.MonoTraversable as MT
7 import Data.Proxy (Proxy(..))
8 import Prelude hiding (zipWith)
9
10 import Language.Symantic.Typing
11 import Compiling.Term.Test
12
13 type Ifaces =
14 [ Proxy (->)
15 , Proxy []
16 , Proxy Integer
17 , Proxy Bool
18 , Proxy Char
19 , Proxy MT.MonoFunctor
20 , Proxy Maybe
21 ]
22 (==>) = test_compile @Ifaces
23
24 tests :: TestTree
25 tests = testGroup "MonoFunctor"
26 [ "omap not (Just True)" ==> Right
27 ( ty @Maybe :$ ty @Bool
28 , Just False
29 , "omap (\\x0 -> not x0) (Just True)" )
30 , "omap Char.toUpper ['a', 'b', 'c']" ==> Right
31 ( ty @[] :$ ty @Char
32 , "ABC"
33 , "omap (\\x0 -> Char.toUpper x0) ('a' : 'b' : 'c' : [])" )
34 ]