Functional dependencies and improvement

Mark P Jones mpj@cse.ogi.edu
Mon, 18 Nov 2002 23:09:16 -0800


Martin,

| In my previous example I employed FD's to 
| improve constraints. However, there are cases where FD's seem 
| to be overly restrictive.

Yes, of course!  So it will be for any extension of the
type system that retains both decidability and soundness.

The particular form of "improvement" that is provided by FDs
represents an engineering trade off, supporting some useful
examples while requiring only a relatively modest extension
to the syntax and semantics of the language.  They do not
(and were never intended to) provide a universal tool that
can handle all possible refinements of type inference with
classes.

More specialized forms of improvement, including instance
specific rules, have been described elsewhere.  My paper on
improvement [1] provides a framework for this and hints at
some examples.  (In fact I think there is another example
buried in comments in the source code for Hugs that few
people have probably ever seen ... assuming that the
current maintainers haven't had any reason to take it
out!  If you're really curious, look in subst.c ...)

All the best,
Mark

[1]  Simplifying and Improving Qualified Types
     http://www.cse.ogi.edu/~mpj/pubs/improve.html