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

Identity class and Monad instance #511

Merged
merged 1 commit into from
Feb 17, 2016
Merged

Conversation

NathanHowell
Copy link
Contributor

Having Identity around is useful for those of us writing Applicative and Monad heavy code.

johnynek added a commit that referenced this pull request Feb 17, 2016
Identity class and Monad instance
@johnynek johnynek merged commit 3705820 into twitter:develop Feb 17, 2016
@johnynek
Copy link
Collaborator

Thanks!

@jnievelt
Copy link
Contributor

Curious why Monad.option doesn't suffice here. Seems like it would only handle null differently?

@NathanHowell
Copy link
Contributor Author

@jnievelt Monad.some is equivalent, Monad.option isn't due to null handling and returning an Option that needs to be pattern matched. Identity is the common name in Haskell (and scalaz) and perhaps more obvious in intent.

@NathanHowell NathanHowell deleted the identity branch February 17, 2016 22:12
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

Successfully merging this pull request may close these issues.

3 participants