You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
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
Yeah, as @taku0 points out. This isn't just syntactic sugar. It provides a version of polymorphism that works with mutually recursive functions, written by @taku0.
I haven't ported it over to the constraint type system but I might now be able to make it work without the where keyword.
Not sure.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 removinglet
(in favor of justfoo bar = baz
with nolet
keyword needed).Can we confirm the decision to drop
where
? If so, I can push removing bothwhere
andlet
.The text was updated successfully, but these errors were encountered: