-
Notifications
You must be signed in to change notification settings - Fork 102
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
Missing "join" method on ADTs #388
Comments
You are correct that the for something to be an actual The good news is, the math allows us to derive this function by simply chaining an identity function as so: import chain from 'crocks/pointfree/chain'
import identity from 'crocks/combinators/identity'
// joinM :: Monad m => m(m a) -> m a
const joinM =
chain(identity) We are totally open to suggestions for how this function should be names, so if possible we would like to keep this issue open to gather suggesions. Would this |
Hi @evilsoft. Yes, that Here are some random - probably not mathematically sound - brainstorm ideas:
On a different note, I wanted to say earlier that I'm really enjoying this library. I tried a few other functional libraries after reading this book and they felt rather abstruse. Things are really clicking for me with |
I am a fan of |
I have strong memories of missing this function, and this looks useful for sure. Since we're prefixing |
I think following the established convention is a good idea, but I don’t think I have enough familiarity with the codebase to give a strong opinion. |
well @mrhubbs this is a pretty good first issue to complete if you'd like to try your hand at contributing to the codebase. @karthikiyengar looks keen to help |
@karthikiyengar the |
@dalefrancis88 I'd love to, thanks for the invitation. However I'm pretty busy the next few weeks. Perhaps it'd be best for @karthikiyengar to take care of it? Does this have a particular timeframe? |
Nope, it's first in best dressed really, and you're the first to ask for it. If Karth gets in there before you then it's all good, there are other things that need to be added :) |
Based on my understanding of many of the ADTs, as described here, I think crocks is missing
join
.Here is a simplified use case (I realize I could create this function with more of the functional building-blocks Crocks supplies):
The problem is that the result is a
Right
inside aRight
.I'd like to be able to do this:
Am I missing something? Is there a different way to use
ap
that wouldn't create nested types?The text was updated successfully, but these errors were encountered: