
7 Aug
2008
7 Aug
'08
3:22 a.m.
On Tue, 5 Aug 2008, Benja Fallenstein wrote:
On Tue, Aug 5, 2008 at 2:19 PM, Henning Thielemann
wrote: The Functor instance of ReaderT has the header: Monad m => Functor (ReaderT r m)
I thought (Functor m) must be the appropriate constraint.
Note that there *is* an advantage to having Monad as the context: not every monad implements Functor, even though it could. So having Functor as the context isn't *trivially* superior.
I know, but if a Monad instance exists, then the Functor instance can be simply added, whereas when the opposite direction is not always possible. So, lifting the constraint from Monad to Functor can break existing packages, but the problems are "easy to fix" (TM). :-)