{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
-{-# OPTIONS_GHC -O0 -fmax-simplifier-iterations=0 #-}
module Lib.Foldable.Test where
import Test.Tasty
import Data.Proxy (Proxy(..))
import Prelude hiding ((&&), not, (||))
-import Language.Symantic.Typing
-import Compiling.Term.Test
+import Language.Symantic.Lib
+import Compiling.Test
-type Ifaces =
+type SS =
[ Proxy (->)
, Proxy Int
, Proxy Integer
, Proxy (,)
, Proxy Foldable
]
-(==>) = test_compile @Ifaces
+(==>) = test_readTerm @() @SS
tests :: TestTree
tests = testGroup "Foldable"
- [ "[] @Integer" ==> Right
- ( ty @[] :$ ty @Integer
- , []
- , "[]" )
- , "[1, 2, 3]" ==> Right
- ( ty @[] :$ ty @Integer
- , [1, 2, 3]
- , "1 : 2 : 3 : []" )
+ [ {-"[]" ==> Right (tyList (tyVar "a" varZ), [], "[]")
+ ,-} "[1, 2, 3]" ==> Right (tyList tyInteger, [1, 2, 3], "1 : 2 : 3 : []")
+ , "1 : 2 : 3 : []" ==> Right (tyList tyInteger, [1, 2, 3], "1 : 2 : 3 : []")
, "foldMap (\\(x0:Integer) -> [x0, x0]) [1, 2, 3]" ==> Right
- ( ty @[] :$ ty @Integer
+ ( tyList tyInteger
, [1, 1, 2, 2, 3, 3]
, "foldMap (\\x0 -> x0 : x0 : []) (1 : 2 : 3 : [])" )
]