[Haskell-beginners] Context reducion Stack overflow

Brent Yorgey byorgey at seas.upenn.edu
Wed May 6 13:59:02 EDT 2009


On Tue, May 05, 2009 at 03:07:16PM -0300, Marco Túlio Gontijo e Silva wrote:
> > and then your automatic lifting instance would be something like
> > 
> >   instance (F f, M f2 a) => M (f :.: f2) a
> > 
> > where :.: denotes functor composition.
> 
> Ok, I think this is another possibility.  But how could I define :.:?

  newtype (g :.: f) a = O { unO :: g (f a) }

Something like this is already defined in both the TypeCompose and category-extras libraries.

-Brent


More information about the Beginners mailing list