The slot-lambda package

[Tags:library, mit]

Write lambdas without naming the parameters. Example:

[s| ı : ı : _ı : ı : _ı : _ı : _0 : [] |] 'a' 'b' 'c'
=  (\x y z -> x:y:y:z:z:z:x:[]) 'a' 'b' 'c'
=  "abbccca"

The unicode character ı(U+0131, not the number 1!) representing a 'slot' can be input in vim with the digraph 'i.' . stands for the same argument as the immediate left ı does. Any suggestions of another unicode character in the 'Letter, Lowercase' category that

1)no one would use as a variable name, and

2)can be easily input in vim

are welcome. You can also use _0,_1,_2,... to refer to the 1st, 2nd, 3rd, ... arguments.

Just import Syntax.Slot and use either [s| ... |] or [slot| ... |], which are the same thing given two names for convenience.

[Skip to Readme]


Dependencies base (>=4.6 && <5), containers (>=, haskell-src-exts (>=, haskell-src-meta (>=, syb (>=0.4.1), template-haskell (>=2.8), vector (>= [details]
License MIT
Author ducis
Category Language
Home page
Uploaded Tue Apr 8 05:00:07 UTC 2014 by ducis
Distributions NixOS:
Downloads 809 total (3 in the last 30 days)
0 []
Status Docs available [build log]
Successful builds reported [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for slot-lambda

Readme for slot-lambda-


Write lambdas without naming the parameters.

[s| ı : ı : _ı : ı : _ı : _ı : _0 : [] |] 'a' 'b' 'c' = "abbccca"