
8 Jan
2012
8 Jan
'12
9:29 a.m.
Hi, I was just looking through the 'Monad Transformers' chapter in Real World Haskell. They are using the "reader" monad to illustrate the transformer structure but I fell off at the first bend when I saw the following: class (Monad m) => MonadReader r m | m -> r where ask :: m r local :: (r -> r) -> m a -> m a Could someone explain the use of a guard here / how to read this with the "| m -> r" ? I haven't come across this usage before (as far as I have noticed :-) and the meaning hasn't jumped out at me yet... Thanks in advance. Henry