unison/unison-src/errors/type-apply.u

17 lines
429 B
Plaintext

--Type.apply
type List a = Nil | Cons a (List a)
map : ∀ a b . (a -> b) -> List a -> List b
map f as = case as of
List.Nil -> List.Nil
List.Cons h t -> List.Cons h (map f t) -- should not typecheck, missing (f h)
-- definitely should not typecheck!
map2 : ∀ a . a
map2 = map
c = List.Cons
z = List.Nil
ex = c 1 (c 2 (c 3 z))
pure-map : List Int64 -- should fail, output is a `List Text`
pure-map = map (a -> "hi") ex
()