
7 Jun
2011
7 Jun
'11
3:52 p.m.
On Tue, 07 Jun 2011 17:35:45 +0200,
Thanks, Daniel.
Quoting Daniel Fischer
: On Tuesday 07 June 2011, 16:59:44, djp@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 state.
Does that mean it's ghc specific, i.e. not in Haskell 98 / 2010?
That is correct. Regards, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html --