Hi, Daniel.

I had an "Aha!" moment and it all makes sense now. Just as the State monad can 
hold a generator (which can change) and pass it down a calculation chain, a 
Reader monad can hold an environment (which doesn't change) and pass it down a 
calculation chain. I was wondering how I could include a (global) house betting 
limit in that craps application I've been playing with (without passing it as a 
parameter) and it sounds like the Reader monad would be an ideal candidate. 
Correct? It also sounds like a job for monad transforms.

Michael

--- On Wed, 12/29/10, Daniel Fischer <daniel.is.fisc...@googlemail.com> wrote:

From: Daniel Fischer <daniel.is.fisc...@googlemail.com>
Subject: Re: [Haskell-cafe] Reader monad
To: haskell-cafe@haskell.org
Cc: "michael rice" <nowg...@yahoo.com>
Date: Wednesday, December 29, 2010, 2:47 PM

On Wednesday 29 December 2010 19:30:11, michael rice wrote:
> Yes, I'd already noticed that ReaderT preceded Reader. Guess I'll have
> to check out the Indentity monad too. I hope it's not dependent upon yet
> another monad. 

No, the Identity monad stands alone.
And as the name suggests, it's pretty simple.




      
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to