Remove "where"?
Opened this issue · 2 comments
rtfeldman commented
There was a mention in chat of the idea that where
was on its way out. Personally I like the idea from a simplification standpoint, but separately, where
is the only obstacle remaining before I can push removing let
(in favor of just foo bar = baz
with no let
keyword needed).
Can we confirm the decision to drop where
? If so, I can push removing both where
and let
.
taku0 commented
Can we infer types of mutually recursive (possibly polymorphic) functions without where
?
For example, is_even
and is_odd
below are mutually recursive functions having a type Number → Number
while id
is a polymorphic function having a type #a → #a
.
let f x =
is_even x
where
is_even x = if id (x == 0) then true else is_odd (id (x - 1))
is_odd x = if id (x == 0) then false else is_even (id (x - 1))
id x = x
If we can, I don't oppose dropping where
.
puffnfresh commented