Assignment versus binding
Anuradha Laxminarayan
lanuradha at gmail.com
Thu Oct 6 06:33:51 EDT 2016
On Thursday, 6 October 2016 14:17:06 UTC+5:30, Gregory Ewing wrote:
> Paul Rubin wrote:
> > It's useful to write some Python things in monadic style, but monads
> > make the most sense as type operators, which don't map onto Python that
> > well.
>
> There probably isn't much point in using the monadic style
> in Python, since the main reason for it is to express
> stateful processes in a functional framework, and Python
> already has more direct ways of expressing stateful processes.
Agreed
>
> Also, if you translate monadic code directly from Haskell
> to Python, you get something which is... not all that
> pleasant to use.
Of course ;-) “Pleasant to use” is not my primary need here.
> You'll see that when I've posted my Python-based monads essay...
The reason I would like this essay is that I want to teach the notion
of first-classing of computation, if possible without the learning curve of
Haskell syntax, type-system etc
There is a well-known joke in the Haskell space that “Haskell is an
excellent imperative language”
I guess this is because monads can first-class arbitrary imperative
(computational) notions.
Since in python the two worlds of purely functional and imperative meet
being able to see this in python would be neat!
- Anuradha
More information about the Python-list
mailing list