slot-lambda: Write lambdas without naming the parameters.
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]
Downloads
- slot-lambda-0.1.0.3.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3 |
---|---|
Dependencies | base (>=4.6 && <5), containers (>=0.5.0.0), haskell-src-exts (>=1.14.0.1), haskell-src-meta (>=0.6.0.5), syb (>=0.4.1), template-haskell (>=2.8), vector (>=0.10.9.1) [details] |
License | MIT |
Author | ducis |
Maintainer | ducis_cn@126.com |
Category | Language |
Home page | https://github.com/ducis/pa_slot |
Uploaded | by ducis at 2014-04-08T05:00:07Z |
Distributions | |
Reverse Dependencies | 1 direct, 0 indirect [details] |
Downloads | 2932 total (4 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs available [build log] Successful builds reported [all 1 reports] |