Tacit programming: Difference between revisions

Content deleted Content added
Line 23:
 
<syntaxhighlight lang="python">
import partial from functools
def compose(*fns):
return functools.partial(functools.reduce, lambda v, fn: fn(v), fns)
 
example = compose(baz, bar, foo)
</syntaxhighlight>
 
For a more complex example, the Haskell code {{code|1=p = ((.) f) . g}} can be translated as:
<syntaxhighlight lang="python">
p = partial(compose, partial(compose, f), g)
</syntaxhighlight>