The desugaring of (, a) would involve some type level lambda, and that's not something that is available (yet).
-- Lennart On Mon, Jan 19, 2009 at 1:49 PM, Holger Siegel <[email protected]> wrote: > Am Montag, den 19.01.2009, 14:47 +0100 schrieb Daniel Fischer: >> Am Montag, 19. Januar 2009 14:31 schrieb Antoine Latter: >> > 2009/1/19 Luke Palmer <[email protected]>: >> > > As a side curiosity, I would love to see an example of any data structure >> > > which has more than one Functor instance. Especially those which have >> > > more than one useful functor instance. >> > >> > (,) ? >> > >> > -Antoine >> >> Wrong kind. And >> (,) a >> has only one useful instance. > > > What about > > instance Functor ((,) a) where > fmap f (x,y) = (x, f y) > > and > > instance Functor (, a) where > fmap f (x, y) = (f x, y) > > ? Of course, the latter is not legal Haskell. But if it was, then it > might be useful. > > Is there any way to declare this Functor instance, possibly with some > GHC extensions? > > > > _______________________________________________ > Haskell-Cafe mailing list > [email protected] > http://www.haskell.org/mailman/listinfo/haskell-cafe > _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
