Get rid of auto-currying, add syntax for currying/partial app. #1071
stylewarning
started this conversation in
Ideas and Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
"Auto-currying" is a very cool feature for some very slick and compact code. I love being able to write
(* 2)
as a doubling function, for example.However, I find that in general, auto-currying is more trouble than the entry fee it paid:
As such, I'd propose we break an ML/Haskell tradition and get rid of it as a default, and instead use another syntax. Some ideas follow. In the following ideas, the spirit is what I'm aiming for, i.e., whether it's
_
or$
or something else is open to discussion.Idea #1: Curry syntax
Suppose
f : t -> t -> t
. The syntax[f x]
would represent the curried functiont -> t
.Idea #2: Same as #1, but with partial application
Suppose the same
f
. Then the above could be written[f x _]
. The other argument could be[f _ x]
. Multiple arguments could bef == [f _1 _2]
andflip f == [f _2 _1]
.Beta Was this translation helpful? Give feedback.
All reactions