On 6/1/12 6:11 AM, Gábor Lehel wrote:
> On Fri, Jun 1, 2012 at 6:29 AM, wren ng thornton<wren at freegeek.org> wrote:
>>>> TypeFamilies (aka TFs)
>> These are really nifty and they're all the rage these days. In
>> a formal sense they're equivalent to fundeps, but in practice
>> they're weaker than fundeps.
>> Is that still true? The reason used to be that we didn't have
> superclass equalities, but we do have them now since 7.2. The only
> drawbacks I know of relative to FDs are that it's sometimes more
> typing, not supported by GeneralizedNewtypeDeriving, and doesn't allow
> OverlappingInstances (ick).
The superclass equalities was a big thing, but the disparity remains even
still.
The main problem is that type inference with fundeps remains more powerful
than type inference for TFs. There are still patterns of use which
infer/check easily with fundeps but which don't have an equivalent TF
implementation. I haven't messed with TFs enough to know the details here,
but there are other folks on the list who do.
In addition there's the issue of overlapping instances, which is currently
being discussed elsewhere.
--
Live well,
~wren