[Haskell-cafe] type families and type signatures
ganesh at earth.li
Mon Apr 7 00:52:44 EDT 2008
On Sun, 6 Apr 2008, Thomas M. DuBuisson wrote:
> Id is an operation over types yielding a type, as such it doesn't make
> much sense to me to have (Id a -> Id a) but rather something like (a ->
> Id a). One could make this compile by adding the obvious instance:
>> type instance Id a = a
> Curiously, is this a reduction from a real world use of families? I
> just can't think of how a (Fam a -> Fam a) function would be of use.
Yes, it's cut down from an example where (I think) I really need the type
signature to specialise a general function that does do something useful.
The generalised intstance above wouldn't be valid or sensible in that
More information about the Haskell-Cafe