Chapter 15 of Real World Haskell defines a class of type:
class (Monad m) => MonadSupply sm | m -> s where
A few paragraphs later, he says that β = and the return does not need to be determined due to context. But there is no explanation of what this means in context.
How does the compiler know that MonadSupply is an instance of Monad, if only "m" is an instance of Monad?
haskell monads typeclass
user394827
source share