Tacit programming: Difference between revisions

Content deleted Content added
Functional programming: "dot operator" could be confusing here, as there are no dots involved in the example.
Tags: Mobile edit Mobile web edit
Luke1337 (talk | contribs)
No edit summary
Tags: Mobile edit Mobile web edit
Line 15:
 
<source lang="python">
def flowcompose(*fns):
return functools.partial(functools.reduce, reducerlambda v, fn: fn(v), fns)
def reducer(v, fn):
return fn(v)
 
example = flowcompose([baz, bar, foo])
return functools.partial(functools.reduce, reducer, fns)
 
example = flow([baz, bar, foo])
</source>