Open linitachi opened 1 year ago
You can use a method bind
.
import expression as ex
a = ex.Some(5)
b = lambda x: ex.Some(x)
a.bind(b)
Thanks for your reply! I think bind is a flatmap and it's diffenrent from applicative, if there are any applicative just like fp-ts apply? https://gcanti.github.io/fp-ts/modules/Apply.ts.html
Thank you again for your reply!
Thanks for your reply! I think bind is a flatmap and it's diffenrent from applicative, if there are any applicative just like fp-ts apply? https://gcanti.github.io/fp-ts/modules/Apply.ts.html
Thank you again for your reply!
@linitachi I'm sorry I left a comment without reading it properly.
You can also use the member function called map2
>>> Some(8).map2(lambda x,y: x+y, Some(6))
Some 14
Is your feature request related to a problem? Please describe. I want to using applicative in expression, like this example https://github.com/dbrattli/OSlash/wiki/Functors,-Applicatives,-And-Monads-In-Pictures#applicatives
Describe the solution you'd like
thanks!