]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Lib/Foldable/Test.hs
Use more TypeApplications.
[haskell/symantic.git] / Language / Symantic / Lib / Foldable / Test.hs
1 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
2 module Lib.Foldable.Test where
3
4 import Test.Tasty
5
6 import Data.Proxy (Proxy(..))
7 import Prelude hiding ((&&), not, (||))
8
9 import Language.Symantic.Typing
10 import Compiling.Term.Test
11
12 type Ifaces =
13 [ Proxy (->)
14 , Proxy Int
15 , Proxy Integer
16 , Proxy []
17 , Proxy ()
18 , Proxy (,)
19 , Proxy Foldable
20 ]
21 (==>) = test_compile @Ifaces
22
23 tests :: TestTree
24 tests = testGroup "Foldable"
25 [ "[] @Integer" ==> Right
26 ( ty @[] :$ ty @Integer
27 , []
28 , "[]" )
29 , "[1, 2, 3]" ==> Right
30 ( ty @[] :$ ty @Integer
31 , [1, 2, 3]
32 , "1 : 2 : 3 : []" )
33 , "foldMap (\\(x0:Integer) -> [x0, x0]) [1, 2, 3]" ==> Right
34 ( ty @[] :$ ty @Integer
35 , [1, 1, 2, 2, 3, 3]
36 , "foldMap (\\x0 -> x0 : x0 : []) (1 : 2 : 3 : [])" )
37 ]