On Fri, Aug 14, 2009 at 12:03 PM, Dan Weston<weston...@imageworks.com> wrote:
> But presumably he can use a data family instead of a type family to restore
> injectivity, at the cost of adding an extra wrapped bottom value and one
> more layer of value constructor?

Actually, you don't even necessarily pay this penalty, since you can
put newtypes into data families.

> data family Foo a
> newtype instance Foo () = UnitFoo Int

You do need to add the constructor wrap/unwrapping in code, but they
all get erased after typechecking.

  -- ryan
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to