Idris2/tests/idris2/basic040/Default.idr
Edwin Brady a972778eab Add test script
They don't all pass yet, for minor reasons. Coming shortly...
Unfortunately the startup overhead for chez is really noticeable here!
2020-05-19 18:25:18 +01:00

22 lines
665 B
Idris

module Default
happyPairs : List (Nat, Char)
happyPairs = map (uncurry $ \ c, n => (n, c)) [('a', 1)]
-- In Idris1 `sadPairs` is rejected with the following error:
-- |
-- 10 | sadPairs = map (\ (c, n) => (n, c)) [('a', 1)]
-- | ~~
-- When checking right hand side of Default.case block in sadPairs at Default.idr:10:19-24 with expected type
-- (Nat, Char)
-- When checking argument a to constructor Builtins.MkPair:
-- Type mismatch between
-- Integer (Type of n)
-- and
-- Nat (Expected type)
sadPairs : List (Nat, Char)
sadPairs = map (\ (c, n) => (n, c)) [('a', 1)]