3 ms·
Great article, but there is one nitpick: you need parentheses in the signature for bind. It should look like (>>=) :: Monad m -- for any monad,
by thinkpad20 12y ago
Great article, but there is one nitpick: you need parentheses in the signature for bind. It should look like
(>>=) :: Monad m -- for any monad,
=> m a -- take wrapped value
-> (a -> m b) -- and a function which needs it unwrapped
-> m b -- unwrap it, and apply that function
Or, written the other way:
(>>=) :: Monad m -- for any monad,
=> m a -- take a wrapped value
-> ((a -> m b) -> m b) -- and return a function which can take an
-- unwrapped value and a wrapped one and
-- return another wrapped one
Which also makes the comments on the second one a bit inaccurate. It should read "return a function which takes a (function from an unwrapped value to a wrapped one) and returns another wrapped one."
- patbrisbin 12y agoThanks, fixed!