[Haskell-cafe] Fundeps and overlapping instances
Etienne Laurin
etienne at atnnn.com
Tue Jun 5 04:18:51 CEST 2012
>> | Abandoning fundeps would be a sad day for type-level programming.
>> | There are many things other than overlaps that you can do with fundeps
>> | and constraint kinds that you cannot currently do with type families,
>> | such as:
>> |
>> | - Partial application or higher-order programming.
>> | - Short-circuit evaluation, lazy evaluation or type-level case.
>>
>> Etienne, I think it would be a good service to make Haskell wiki page
> describing the difference between
>> fundeps and type families, and in particular describing things that can be
> done with the former but not the latter.
>>
>>
>> Simon
Thanks for the idea. Here it is.
http://hackage.haskell.org/trac/ghc/wiki/TFvsFD
I posted my comments on the matter along with many additional comments
and examples that I found.
> +1 That would be great. I'll link to Etienne's wiki from the Discussion page
> I've started for NewAxioms http://hackage.haskell.org/trac/ghc/wiki/NewAxioms
>
> In particular, it would be good to tease out where we're getting interference
> or inter-dependence between different type-level extensions:
> Overlaps
> Fundeps
> UndecidableInstances (that is, breaking the coverage conditions)
> ScopedTypeVariables
I did not check what extensions were turned on in my examples.
> Given that that the Fundeps idea is taken from relational theory, and
> relations is just another way of representing functions, there ought to be
> close correspondence to type-level functions.
I put a few examples of the unexpected behaviour of Fundeps on the Wiki page.
> To me, NewAxioms is aiming at type-level case, to provide a different style of
> defining type functions, as well as dis-overlapping overlaps.
I am eager to see that in action.
Etienne Laurin
More information about the Haskell-Cafe
mailing list