Hi,
suppose that there is following data family:
> data family D a
> data instance D Int = DInt Int
> data instance D Bool = DBool Bool
it is not possible to match on constructors from different instances:
> -- type error
> a :: D a -> a
> a (DInt x) = x
> a (DBool x) = x
however, following work
> Would you expect this to work?
>
> newtype DInt a = DInt a
> newtype DBool a = DBool a
>
> type family D a
> type instance D Int = DInt Int
> type instance D Bool = DBool Bool
>
> a :: D a -> a
> a (DInt x) = x
> a (DBool x) = x
>
> Or even better:
>
> data family D a
> data instance D Int =