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

Yet another Applicative? #350

Open
treeowl opened this issue Oct 13, 2021 · 1 comment
Open

Yet another Applicative? #350

treeowl opened this issue Oct 13, 2021 · 1 comment

Comments

@treeowl
Copy link
Collaborator

treeowl commented Oct 13, 2021

[] and Data.Sequence seem almost the opposite of data Applicative: pure is linear, but liftA2 is not. Are there other types like this?

@aspiwack
Copy link
Member

They're data monads. (that's return :: a %1 -> M a; (>>=) :: M a %1 -> (a %-> M b) -> M b (note the one unrestricted arrow in (>>=)).

I don't think that the unrestricted liftA2 can be deduced from the data monad structure. But many data monads are also monads in Hask, therefore have this unrestricted liftA2.

The problem with seeing them as applicatives as you suggest is that I can't really see a way to relate pure and liftA2 that I can see.

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