TypeFamilies vs. FunctionalDependencies & type-level recursion

Ben Millwood haskell at benmachine.co.uk
Mon May 30 00:45:31 CEST 2011

On Sun, May 29, 2011 at 7:59 PM, David Mazieres
<dm-list-haskell-prime at scs.stanford.edu> wrote:
> One of the more disgusting but also powerful implications of
> FunctionalDependencies is that, in conjunction with
> OverlappingInstances and UndecidableInstances, you can do recursive
> programming at the type level.  This has been (ab)used to do some cool
> things (e.g., HList, HaskellDB, OOHaskell).

It would seem very strange to me if haskell-prime made the choice of
fundeps/type families based on the behaviour with
OverlappingInstances. I'm under the impression that Overlapping is
generally considered one of the more controversial extensions, and on
the LanguageQualities wiki page [1] it's explicitly given as an
example of something which violates them. So not only is Overlapping
not in the language, but I imagine there are many people (myself
included) who would like to ensure it stays out.

My personal opinion is that if Haskell wants a more complete facility
for type-level programming, that should be addressed directly, instead
of via creative abuse of the class system and related machinery.


[1]: http://hackage.haskell.org/trac/haskell-prime/wiki/LanguageQualities

More information about the Haskell-prime mailing list