collecting requirements for FDs

Jean-Philippe Bernardy jeanphilippe.bernardy at
Wed Apr 12 04:43:41 EDT 2006


I just moved the documentation (still accessible from the below wiki
page) to here:
the source being:

And, since you asked for it, there is something I think would be nice to have.

As you may have found out by reading the above documentation, I've
been trying to put Sets and Maps into the same class-framework. (Or,
to put differently, unify collections and associative collections).
The result of this, as Jim said, is I get two range parameters:

class Map m k a | m -> k a where ...

The value type for sets being ().

instance Map IntSet Int () where ...

This is all very well, except that it complexifies some type contexts,
and is also a bit restrictive in some respects: intersectionWith must
have type (a -> a -> a) -> m -> m -> m, instead of (a -> b -> c) -> m
a -> m b -> m c, if Map was (partially) a constructor class.

One way to reconcile both approaches would be to have both classes:

class Map m k a | m -> k a where ...
class Map_ m k | m -> k where ...

In order to avoid redundancy though, I'd wish to relate the classes like this:

class Map (m a) k a => Map_ m k | m -> k where ...

This is rejected by GHC, and I suspect every current haskell
implementation. Before you ask, I haven't worked out the implications
in terms of confluence. But I thought I might just as well express my
wish. :)


On 4/11/06, Jim Apple <jbapple+haskell-prime at> wrote:
> On 4/10/06, Ross Paterson <ross at> wrote:
> > What other libraries should Haskell' support, and what are their
> > requirements?
> There are two "range arguments" here, IIUC.
> Jim
> _______________________________________________
> Haskell-prime mailing list
> Haskell-prime at

More information about the Haskell-prime mailing list