Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 475 Bytes

README.md

File metadata and controls

14 lines (10 loc) · 475 Bytes

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.