[Haskell-cafe] Pythonic monads

Collin Winter collinw at gmail.com
Fri Feb 3 15:28:20 EST 2006

On 2/3/06, Graham Klyne <GK at ninebynine.org> wrote:
> I have noticed that, while I like to use functional idioms in some of my Python
> code, and the Python language is easily able to support these (even some lazy
> evaluation, courtesy of generators), that the code doesn't always look as clean
> as its Haskell equivalent.  In Haskell, composition and currying are fundamental
> patterns and are directly supported by the syntax.  In Python, one has to work
> harder to achieve these (e.g. the "curry" function above seems rather convoluted
> to me, for such a fundamental notion).
> Thoughts? Comments?

Hi Graham,

You might be interested in my `functional` package. It includes tools
for composition, partial application, flip, foldl, foldr, scanl and
scanr, all coded as C extensions for speed. I initially wrote the code
to scratch my own more-functional-programming-in-Python itch; maybe it
can help you out in that department as well : )


Feedback always appreciated.

Collin Winter

More information about the Haskell-Cafe mailing list