No description
Find a file
2023-05-04 03:19:29 +03:00
.github initial 2023-05-04 03:19:29 +03:00
src initial 2023-05-04 03:19:29 +03:00
tests initial 2023-05-04 03:19:29 +03:00
.gitignore initial 2023-05-04 03:19:29 +03:00
dirtydeeds.nimble initial 2023-05-04 03:19:29 +03:00
README.md initial 2023-05-04 03:19:29 +03:00

dirtydeeds

Quick and dirty partial application of calls with possible typed arguments.

import dirtydeeds, sequtils

assert @[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.