3 ms·
Shouldn't `hamon2` be hamon2 f (Just x) = f x hamon2 f Nothing = Nothing ? The author's definition doesn't seem to typecheck if `f :: a -> Maybe b`
by JadeNB 15y ago
Shouldn't `hamon2` be
hamon2 f (Just x) = f x
hamon2 f Nothing = Nothing
? The author's definition doesn't seem to typecheck if `f :: a -> Maybe b` (as in `(>>=)`).
EDIT: Ah, I see; looking at the blackboard picture suggests that the author has confused `(>>=) :: Monad m => m a -> (a -> m b) -> m b` with `fmap :: Functor m => (a -> b) -> m a -> m b`.