Are fundeps the right model at all?

Tom Pledger Tom.Pledger@peace.com
Mon, 8 Jan 2001 17:53:35 +1300


Marcin 'Qrczak' Kowalczyk writes:
 > Could somebody show an example which requires fundeps and cannot be
 > expressed using a simpler model explained below - a model that I
 > can even understand? Is the model self-consistent at all?
 > 
 [a model which uses key constraints instead of functional dependencies]

Hi.

Try this:

    class C a b c | b -> c
    instance C t () t

Hugs rejects it.

If we try to express C with keys instead of fundeps, the key must
contain both a and b, which is equivalent to this:

    class C a b c | a b -> c
    instance C t () t

Hugs accepts this, but only because the constraint has been weakened
to something which can be expressed with keys.

It's quite a contrived example, and I'm not sure how it relates to
your later statement:

 > Having types with type variables which are never instantiated nor
 > constrained should be equivalent to having ground types!

Do you have any examples of such a type variable in an instance decl?
I'm having trouble imagining it, because I keep running into
unnecessary class parameters and overlapping instances.

Regards,
Tom