-
Notifications
You must be signed in to change notification settings - Fork 67
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
bind has different semantics than fmap #186
Comments
As I understand it, cats is based (in part) on Haskell and its semantics. I've copied the relevant parts from class Functor f where
fmap :: (a -> b) -> f a -> f b
class Applicative m => Monad m where
-- | Sequentially compose two actions, passing any value produced
-- by the first as an argument to the second.
(>>=) :: forall a b. m a -> (a -> m b) -> m b The code above shows
|
gotcha. makes sense to be consistent with haskell... still don't know the reasoning behind the different ordering tho |
No reason other than the signatures of the Haskell methods. I agree that is a bit inconsistent. |
I may not understand the underlying reasoning, but
fmap
takes parametersf mv
whereasbind
takesmv f
, so if you wanted to thread these it would be difficult. Is there a reason why the order is different?The text was updated successfully, but these errors were encountered: