Author | Message |
---|---|
kmarlis
Posts: 35
|
Posted 10:59 Apr 05, 2019 |
Hey everyone! I just wrote up a fairly lengthy post about having trouble chaining together bind s(using the Monad/Maybe implementation from the prompt) for the Walk the Line implementation, and right before I hit submit I remembered curry from toolz. It solved my problem splendidly and I just thought I'd put that out there in case anyone else has trouble. |
jpatel77
Posts: 44
|
Posted 11:02 Apr 05, 2019 |
Toolz is the 8th wonder for Python. Just so good. |
rabbott
Posts: 1649
|
Posted 12:27 Apr 05, 2019 |
Soo pointed out that
Last edited by rabbott at
12:28 Apr 05, 2019.
|
rabbott
Posts: 1649
|
Posted 12:48 Apr 05, 2019 |
DeLaat provides a nice write-up of PyMonad on its pypi page. The discussion of the
@curry
def add(x, y):
...
@curry
def subtract(y, x):
...
x = unit(State, 1) >> add(2) >> add(3) >> subtract(40) >> add(5)
You should look at the entire example. (It's short.)
Last edited by rabbott at
12:50 Apr 05, 2019.
|