[Haskell-beginners] Feature request: anonymous arguments

Julius Gedvilas xged90 at gmail.com
Sat Aug 30 07:21:22 UTC 2014


Anonymous argument (AA) is an argument without a name.

w/o AA:
func :: a -> a -> a -> a
func aa0 aa1 aa2 = aa0 `op` aa1 `op` aa2
\aa0 aa1 aa2 -> aa0 `op` aa1 `op` aa2

w/ AA:
func :: a -> a -> a -> a
func = \0 `op` \1 `op` \2
\-> \0 `op` \1 `op` \2

AA syntax: '\n', where n is one of the (0 1 2 3 4 5 6 7 8 9). 'n'
corresponds to the position of a parameter.

I think a language shouldn't force you to invent names for things that are
used only once, same philosophy as with an anonymous function.

Is this feature needed? Does something like this already exist?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140830/45f1ab4a/attachment.html>


More information about the Beginners mailing list