mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-20 23:07:13 +03:00
17 lines
429 B
Plaintext
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
|
|
()
|
|
|