Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/metagn/dirtydeeds
sugar for partially applied calls
https://github.com/metagn/dirtydeeds
Last synced: about 1 month ago
JSON representation
sugar for partially applied calls
- Host: GitHub
- URL: https://github.com/metagn/dirtydeeds
- Owner: metagn
- Created: 2023-05-04T00:19:34.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-05-04T00:19:38.000Z (over 1 year ago)
- Last Synced: 2024-05-01T22:24:08.766Z (7 months ago)
- Language: Nim
- Homepage:
- Size: 2.93 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# dirtydeeds
Quick and dirty partial application of calls with possible typed arguments.
```nim
import dirtydeeds, sequtilsassert @[1, 2, 3].map(deed _ * 7) == @[7, 14, 21]
assert @["A", "B", "C"].map(deed "foo" & (_: string)) == @["fooA", "fooB", "fooC"]
assert @['a', 'f', 'A', '0', 'c'].filter(deed contains({'a'..'z'}, _)) == @['a', 'f', 'c']
```More uses in tests. Note that this is currently only for partial application,
things like `_ + (_ - 1)` will not work.