[Haskell-beginners] How to interpret the definition of MonadState

Daniel Fischer daniel.is.fischer at googlemail.com
Tue Jun 7 17:08:12 CEST 2011

On Tuesday 07 June 2011, 16:59:44, djp at arqux.com wrote:
> I am confused about the definition of MonadState. The opening line
> looks like this:
> class Monad m => MonadState s m | m -> s where
> It is the vertical bar | that confuses me. What does that mean? How
> would one read this line in "natural language", say English?

The vertical bar signifies a functional dependency (cf. the ghc users' 
guide for details). It says here, that the monad determines the type of the 

Read it

class (demanding a Monad instance for m) MonadState m s, m determining s 
uniquely, where ...

More information about the Beginners mailing list