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
One thing I've noticed wrt to user defined types, we define them with parens:
struct Foo(a: Int)
and can treat them as functions or names:
f = Foo(1)
f = Foo { a: 1 }
The function application style is actually also auto currying (like all functions).
An alternate approach would be to only use the named style:
struct Foo { a: Int }
f = Foo { a: 1 }
this regularizes the syntax a bit but makes the currying style more verbose:
# original
struct Foo(a: Int, b: Int)
make_with_a1 = Foo(1)
# this is now Foo(1, 2)
f = make_with_a1(2)
# in the proposal:
struct Foo { a: Int, b: Int }
make_with_a1 = \b -> Foo { a: Int, b }
f = make_with_a1(2)
This is a list of syntax issues that seem irregular or confusing and should be possibly changed.
The text was updated successfully, but these errors were encountered: