Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monad transformers with mapT, flatMapT and else #205

Open
saltylight opened this issue Feb 20, 2019 · 1 comment
Open

Monad transformers with mapT, flatMapT and else #205

saltylight opened this issue Feb 20, 2019 · 1 comment
Assignees
Milestone

Comments

@saltylight
Copy link

saltylight commented Feb 20, 2019

Protocol-Oriented Monad Transformer

In that youtube link you can see monad transformers such as mapT, mapTT, flatMapT, else.

By using mapT we can change our codes as below.

Identity(Maybe.of(1)).map(maybe => maybe.map(x => x + 1)) // this code transforms Identity(Just(1)) to Identity(Just(2))

Identity(Maybe.of(1)).mapT(x => x + 1) // this code does same thing as above

I know there is 'MonadT' styled monad transformation in Haskell world, but I think both can exist in monet.js

Need some comment and idea about this.

@ulfryk ulfryk self-assigned this Mar 16, 2019
@ulfryk ulfryk added this to the 1.0.0 milestone Mar 16, 2019
@ulfryk
Copy link
Member

ulfryk commented Mar 16, 2019

Hmm. Protocol oriented monad transformers will not be easy to type using typescript.

I was also thinking about dropping current monadT impl from monet (maybe reintroduce it as a separate helper lib for monet)

This is not that easy in JS world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants