I'm just starting to feel comfortable working inside IO; now I am trying
to wrap my head around Control.Monad.State. Looking at the
implementation, I came across some unfamiliar syntax...
class (Monad m) => MonadState s m | m -> s where
What is the meaning of "| m -> s"? I found no mention o
That | m -> s reads "where m determines s", and means that there can
be at most one s (here, the state type) for a given m (the monad
type). This is used in type inference and checking to ensure that the
type of state being carried around by a monad in MonadState is well
defined, and to prevent you
Am Freitag, 7. Oktober 2005 06:32 schrieb Cale Gibbard:
> That | m -> s reads "where m determines s", and means that there can
> be at most one s (here, the state type) for a given m (the monad
> type). This is used in type inference and checking to ensure that the
> type of state being carried aro
Tom Hawkins wrote:
I'm just starting to feel comfortable working inside IO; now I am trying
to wrap my head around Control.Monad.State. Looking at the
implementation, I came across some unfamiliar syntax...
class (Monad m) => MonadState s m | m -> s where
For a simple state monad the class