-
Notifications
You must be signed in to change notification settings - Fork 29
Unintuitive Functor and Applicative instances #54
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
Comments
It's not possible to have Stream (Of a) m r
^ ^
| `--- This is what `Functor` and `Applicative` uses
`--- This is what S.map/S.zipWith uses Then note what you get from each :: f a -> Stream (Of a) m () Hopefully there it's clear why |
The pipes library includes a newtype that shuffles the |
We could add a proper |
@ocharles yup, it's clear that I think that a newtype with a changed behavior would indeed be useful. |
see PR #71 . A few small questions posed there; would love your input. |
I'm not sure this even needs to be documented. If you understand haskell's kind system, then this makes perfect sense. Should this be closed? |
I think it would be fine attach documentation to the |
see #81 |
I had expected that
S.map
andfmap
would work the same. E.g., to my mind these should have been equivalent:Because that's what happens to lists with
map
andfmap
. Insteadfmap
only affects the result of the stream.Similarly, with the
Applicative
instance:What is the motivation behind such an implementation? There's certainly a downside for me here since, it seems, I can't have a general function working on Functors that would do the same thing for lists and streams.
The text was updated successfully, but these errors were encountered: