Skip to content

metagn/dirtydeeds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

sugar for partially applied calls

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages