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

Henk-Jan van Tuyl hjgtuyl at chello.nl
Tue Jun 7 21:52:14 CEST 2011


On Tue, 07 Jun 2011 17:35:45 +0200, <djp at arqux.com> wrote:

> Thanks, Daniel.
>
> Quoting Daniel Fischer <daniel.is.fischer at googlemail.com>:
>
>> 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
>> 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
--



More information about the Beginners mailing list