[Haskell-beginners] Monad and bind operator interpretation

Dániel Arató exitconsole at gmail.com
Mon Dec 14 18:17:23 UTC 2015


On 14/12/2015, Raja <rajasharan at gmail.com> wrote:
> So extending this interpretation - can I swap the two parameters (?)
>
> Now my new hypothetical interpretation becomes:
>
> (>>=) :: (a -> m b) -> m a -> m b

Sure,
bind' :: Monad m => (a -> m b) -> m a -> m b
bind' = flip (>>=)

> If i further add parens:
>
> (>>=) :: (a -> m b) -> (m a -> m b)

Yeah, that's exactly the same thing. Types are right associative.


More information about the Beginners mailing list