[Haskell-cafe] ANNOUNCE slot-lambda
ducis_cn at 126.com
Tue Apr 8 01:34:48 UTC 2014
Thanks. [s|_0 + _1|] = \x y->x+y is supported. I simply like [s|_+_|] better personally. And [s|_+_ı|] is for \x->x+x. I have to admit that 'ı' character is not very recognizable though. Any suggestions of another 'Letter, Lowercase' unicode character that no one would use as a variable name and can be easily input in vim are welcome.
At 2014-04-08 05:12:26,"Alois Cochard" <alois.cochard at gmail.com> wrote:
In order to give a more constructive feedback, why not simply indexing arguments by position and use the `_N` syntax?
The second example would be:
_0 : _1 : _1 : _2 : _2 : _2 : _0 : 
One could just use `_` if there is only one arg:
_ + _ (which mean what Kim thought it would mean)
_0 + _1 (for the case you wanted to support)
On 7 April 2014 22:01, Alois Cochard <alois.cochard at gmail.com> wrote:
I just want to add that I find the syntax extremely confusing and counter intuitive.
I thought it was just me, or that I was missed something. But it looks like I'm not the only one.
On 7 April 2014 21:58, Kim-Ee Yeoh <ky3 at atamo.com> wrote:
On Mon, Apr 7, 2014 at 11:02 PM, ducis <ducis_cn at 126.com> wrote:
It lets your write lambdas with 'slots' without inventing names for the parameters.
[s| ı + ı |] = \x y -> x+y
I have no background in this 'slot lambda' and a search reveals this package as the only hit.
Which may explain why I find the example given confusing. Why would [s| 1+1 |] not be equivalent to \x->x+x ?
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe