[Haskell-cafe] Name that function =)
Cale Gibbard
cgibbard at gmail.com
Tue Dec 12 13:33:23 EST 2006
On 12/12/06, Louis J Scoras <louis.j.scoras at gmail.com> wrote:
> What I didn't realize is that even though the documentation for
> Control.Monad says that (->(r)) is an instance, it must not be defined
> there. Importing Control.Monad.Reader indeed does make it work,
> thanks for pointing that out again.
>
> So I guess my next question would be, looking here
>
> http://haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html
>
> How do I figure out that the instance declaration is actually in the
> Reader module? Is it just because the (->) constructor is special --
> or just not hyperlinked?
It's pretty subtle, but the Haddock there does list an instance of
MonadReader r ((->) r).
In newer GHC's the instance is also found in Control.Monad.Instances.
In my opinion, it belongs in the Prelude. :)
- Cale
More information about the Haskell-Cafe
mailing list