Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-14 Thread Rustom Mody
On Friday, October 14, 2016 at 10:31:36 AM UTC+5:30, Marko Rauhamaa wrote: > Gregory Ewing : > > > Marko Rauhamaa wrote: > >> This suggests even the promoters of functional programming > >> intuitively prefer imperative programming, but that's ok as long as > >> it's all functional under the hood.

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-13 Thread Marko Rauhamaa
Gregory Ewing : > Marko Rauhamaa wrote: >> This suggests even the promoters of functional programming >> intuitively prefer imperative programming, but that's ok as long as >> it's all functional under the hood. > > You make it sound like functional programmers like functional > programming becaus

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-13 Thread Gregory Ewing
Marko Rauhamaa wrote: This suggests even the promoters of functional programming intuitively prefer imperative programming, but that's ok as long as it's all functional under the hood. You make it sound like functional programmers like functional programming because it gives them a warm fuzzy f

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-13 Thread Marko Rauhamaa
Gregory Ewing : > Steve D'Aprano wrote: >> The way you can usually tell your functional language has given up >> purity in favour of mutating implementations is that your code >> actually runs with non-toy amounts of data :-) > > Hmmm. Your argument here seems to be: "Everyone knows that functional

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-13 Thread Gregory Ewing
Steve D'Aprano wrote: The way you can usually tell your functional language has given up purity in favour of mutating implementations is that your code actually runs with non-toy amounts of data :-) Hmmm. Your argument here seems to be: "Everyone knows that functional languages are impractical,

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-12 Thread Steve D'Aprano
On Wed, 12 Oct 2016 11:52 pm, Gregory Ewing wrote: > Steven D'Aprano wrote: >> "the implementation is free to use in-place mutations of the state object >> – ... without letting anyone know that the implementation has given up >> any functional purity." > > If it's impossible to tell that functio

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-12 Thread Gregory Ewing
Steven D'Aprano wrote: "the implementation is free to use in-place mutations of the state object – ... without letting anyone know that the implementation has given up any functional purity." If it's impossible to tell that functional purity has been given up, then in what sense has it been gi

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-12 Thread Steven D'Aprano
On Sunday 09 October 2016 18:48, 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 Quoting from the essay: "the implementation is free to use in-place mutations of th

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-11 Thread Gregory Ewing
Paul Rubin wrote: Also if this operation is what it looks like, it's usually called "bind". seq is something else entirely. Ah, I hadn't realised there was already a function in Haskell called seq -- sorry about that! I don't really want to call the Python version 'bind', because it seems a b

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-11 Thread Gregory Ewing
Anuradha Laxminarayan wrote: 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. Well, for the subset of monads I'm talking about, it always is a function -- it's the continuation to be run after f and g. -- G

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-11 Thread Rustom Mody
On Tuesday, October 11, 2016 at 9:53:25 PM UTC+5:30, Anuradha Laxminarayan wrote: > 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/Demyst

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-11 Thread Paul Rubin
Anuradha Laxminarayan writes: > seq f g x = f (\s1 -> g x s1) > because naming conventions imply that h is function. Also if this operation is what it looks like, it's usually called "bind". seq is something else entirely. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-11 Thread Anuradha Laxminarayan
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.

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-10 Thread Paul Rubin
Paul Rubin writes: >https://www.cs.cmu.edu/~edmo/silliness/burrito_monads.pdf Whoops, url changed: http://emorehouse.web.wesleyan.edu/silliness/burrito_monads.pdf -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-10 Thread Paul Rubin
Gregory Ewing writes: > Oh, undoubtedly. I just don't think it helps understand how burritos > are used in prog... er, that is, how monads... well, you know what I > mean. How about in math? https://www.cs.cmu.edu/~edmo/silliness/burrito_monads.pdf ;-) -- https://mail.python.org/mailman/lis

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Gregory Ewing
Paul Rubin wrote: Well, at least I refrained from saying that monads are like burritos! But they are! See: http://blog.plover.com/prog/burritos.html Oh, undoubtedly. I just don't think it helps understand how burritos are used in prog... er, that is, how monads... well, you know what I mean.

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Rustom Mody
On Sunday, October 9, 2016 at 1:18:32 PM 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 Greg... looks v useful... the co

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
> Well, at least I refrained from saying that monads are like burritos! But they are! See: http://blog.plover.com/prog/burritos.html -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Ben Finney
Gregory Ewing writes: > Here's the first part of the essay I said I'd write about > monads: Thank you for tackling this. > http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html You appreciate an important feature of this: Often it is presented in a very abstrac

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
Gregory Ewing writes: > Not sure where I got [h|t] from -- maybe I was thinking of Prolog?) I've never used Prolog. Erlang is said to have Prolog-like syntax and it uses [h|t], so maybe Prolog uses it too. (Erlang was originally written in Prolog). -- https://mail.python.org/mailman/listinfo/p

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread BartC
On 09/10/2016 11:35, Gregory Ewing wrote: Paul Rubin wrote: Gregory Ewing writes: http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/ Well, at least I refrained f

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Gregory Ewing
Paul Rubin wrote: Gregory Ewing writes: http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/ Well, at least I refrained from saying that monads are like burritos! I

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Gregory Ewing
Paul Rubin wrote: [h|t] should say h:t . Thanks, corrected. (You can probably tell I'm not a regular Haskell user. Not sure where I got [h|t] from -- maybe I was thinking of Prolog?) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
Gregory Ewing writes: > http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html Erratum in Haskell section: Lists in Haskell are linked lists, and [h|t] represents a list whose first element is h and the rest of the list is t. [h|t] should say h:t . -- https:/

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Paul Rubin
Gregory Ewing writes: > http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads.html https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/ -- https://mail.python.org/mailman/listinfo/python-list

Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Gregory Ewing
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 -- https://mail.python.org/mailman/listinfo/python-list