Hi, Michael.

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.  ;-)

Thanks for the link. I go there a lot.

Michael

--- On Wed, 12/29/10, Michael Lazarev <lazarev.michael@gmail.com> wrote:

From: Michael Lazarev <lazarev.michael@gmail.com>
Subject: Re: [Haskell-cafe] Reader monad
To: "michael rice" <nowgate@yahoo.com>
Cc: haskell-cafe@haskell.org
Date: Wednesday, December 29, 2010, 12:42 PM



2010/12/29 michael rice <nowgate@yahoo.com>
>
> From the docs (and tuts) newtype creates a new type out of an existing type
> and gives a single constructor for doing so.
>
> what is the existing type?


Michael, you may want to see this section:
http://learnyouahaskell.com/functors-applicative-functors-and-monoids#the-newtype-keyword
and also section titled "type vs. newtype vs. data" below. It has good explanation why there is
at least three keywords in Haskell to define types, and which of them do what. And how they do it.

From my experience, this book in a whole could be useful to you. It also has explanation how Reader
is constructed step-by-step.

As far as I know, there has been code for Reader monad in Haskell Wiki. Unfortunately,
after it has been migrated, "page not found" error has become not very uncommon on it, and
either i was not able to found it, or it really is missing.

Out of practical considerations, library authors decided to define more complicated ReaderT monad transformer,
because it can be made to behave as Reader if the former wraps Identity monad.

Hope this helps.