[x] if expressions must cover all possible type values or have an "else" branch:
; passes type check
; should fail because arguments except 1 and 2 do not have a return value
(? 1 "one" 2 "two")
Fixed in #14
[ ] function argument patterns must match all possible inputs
; passes type check
; should fail because not all inputs have a function body
(def f
1 => "one"
2 => "two")
; OK, because the name can be bound to any input value
(def f
1 => "one"
2 => "two"
_ => "other")
This seems simple enough in this case, but I'm not sure how to do it for all lists:
; should fail
; but how do infinite types (e.g. Number) and finite types (Boolean) differ?
(def f
(1|t) => "a"
(h|(2|t)) => "b"
(h|(i|'(1))) => "c")
if
expressions must cover all possible type values or have an "else" branch:Fixed in #14
This seems simple enough in this case, but I'm not sure how to do it for all lists: