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!

--
Live well,
~wren

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to