Python-based monads essay (Re: Assignment versus binding)
Anuradha Laxminarayan
lanuradha at gmail.com
Tue Oct 11 12:19:32 EDT 2016
On Sunday, 9 October 2016 13:18:32 UTC+5:30, Gregory Ewing wrote:
> Here's the first part of the essay I said I'd write about
> monads:
>
> http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html
>
> Hope it's useful,
> Greg
Thanks, that made a very interesting read.
In Haskell, the type M a -> M b-> M b tells a good deal of the story of seq
In a Pythonic context, continuations seem to be an effective way to carry that story.
Small minor haskell suggestions from a pedagodic pov
[related to Ben Finney's suggestion?]
seq f g h = f (\s1 -> g h s1)
better be written as
seq f g x = f (\s1 -> g x s1)
because naming conventions imply that h is function.
- Anuradha
More information about the Python-list
mailing list