On Tue, Jan 22, 2013 at 7:41 AM, wren ng thornton <w...@freegeek.org> wrote: > On 1/21/13 1:40 AM, Shachaf Ben-Kiki wrote: >> >> For example: >> >> {-# LANGUAGE TypeFamilies #-} >> import Unsafe.Coerce >> >> newtype Id a = MkId { unId :: a } >> >> {-# RULES "fmap unId" fmap unId = unsafeCoerce #-} >> >> data family Foo x y a >> data instance Foo x y (Id a) = FooI x >> data instance Foo x y Bool = FooB { unB :: y } >> >> instance Functor (Foo x y) where fmap = undefined > > > You can define instances for type functions? Eek! >
Only for data families / instances. -- Your ship was destroyed in a monadic eruption. _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users