Combining IO and state monads
Dean Herington
heringto@cs.unc.edu
Fri, 16 May 2003 13:07:04 -0400
Graham Klyne wrote:
> This may be a very dumb question, but...
>
> I've been digging around Monad transformers, trying to get the feel of how
> to use them. In part, I'm referring to the library source code, and come
> across the following in Control.Monad.State, which I'm having trouble
> figuring out:
>
> [[
> -- MonadState class
> --
> -- get: returns the state from the internals of the monad.
> -- put: changes (replaces) the state inside the monad.
>
> class (Monad m) => MonadState s m | m -> s where
> get :: m s
> put :: s -> m ()
> ]]
>
> What does the vertical bar "|" in the class declaration mean? I can't find
> this use mentioned in the Haskell report or the GHC type system extensions.
>
> #g
See:
http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#FUNCTIONAL-DEPENDENCIES
Dean