1 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
2 module Lib.Map.Test where
6 import Data.Map.Strict (Map)
7 import Data.Proxy (Proxy(..))
8 import Data.Text as Text
9 import Prelude hiding (zipWith)
10 import qualified Data.Map.Strict as Map
12 import Language.Symantic.Lib
26 (==>) = test_readTerm @() @SS
29 tests = testGroup "Map"
30 [ "Map.fromList (zipWith (,) [1, 2, 3] ['a', 'b', 'c'])" ==> Right
31 ( tyMap tyInteger tyChar
32 , Map.fromList [(1, 'a'), (2, 'b'), (3, 'c')]
33 , "Map.fromList (zipWith (\\x0 -> (\\x1 -> (x0, x1))) (1 : 2 : 3 : []) ('a' : 'b' : 'c' : []))" )
36 , " (\\(k:Integer) (v:Char) (acc:(Integer,[Char])) ->"
37 , " (k + fst acc, v : snd acc))"
39 , " (Map.fromList (zipWith (,) [1, 2, 3] ['a', 'b', 'c']))"
41 ( tyInteger `tyTuple2` tyString
43 , "Map.foldrWithKey (\\x0 -> (\\x1 -> (\\x2 -> (x0 + fst x2, x1 : snd x2)))) (0, []) (Map.fromList (zipWith (\\x0 -> (\\x1 -> (x0, x1))) (1 : 2 : 3 : []) ('a' : 'b' : 'c' : [])))" )