Associated type instances
AntC
anthony_clayden at clear.net.nz
Tue Jun 24 04:34:14 UTC 2014
> Simon Peyton Jones <simonpj <at> microsoft.com> writes:
>
> Relevant bits of the user manual: ...
>
Thanks Simon, IIRC when assoc type families/instances were first introduced,
the type's parameters had to exactly match the class header. Reading through
the manual there, it all sounds like it's got a bit what Wirth called
'baroque' [describing Modula].
The complexity in assoc type instances looks as though it's mostly to support
type defaults. I guess the effect is that assoc types are now not exactly
shorthand for stand-alone type families(?) [It might be worth a note in the
manual section 7.7.3.2. to say that defaulting takes assoc types beyond type
families? Or at least that you should mentally expand the instances and fill
in from default(s) before thinking in terms of type families?]
I rarely use assoc types, preferring stand-alone families (even if I think of
them as associated).
>
> Does anyone object?
Not me.
AntC
More information about the ghc-devs
mailing list