class Monad m where
return :: a -> m a
(>>=) :: m a -> (a -> m b) -> m b
(>>) :: m a -> m b -> m b
m >> n = m >>= \_ -> n
fail :: String -> m a
我以前从未在 typeclass 中看到过方程式(或函数声明?)。为什么 typeclass 中有一个方程?
我知道_是匹配任何东西的术语。但是m >>= \_ -> n匹配什么?