On Mon, 4 Oct 1999, Joe English wrote:

> Kevin Atkinson wrote:
> 
> > "Generic comparison function" is not really what I mean here.  What I
> > mean is a single generic union which will have its
> > comparison function default to (==) if one is not specified.
> >
> > It COULD be written something like
> >
> > union (cmp = (==)) l1 l2
> >   ...
> > where
> >   union l1 l2
> > means
> >   union (==) l1 l2
> 
> I don't quite see what algorithm you're using
> to decide how many arguments are passed
> to the function.

Neither do I.  I meant to express a general idea.  Perhaps that is not the
best way to do it but that is what I would like to be able to do.

> What would you get if you typed:
> 
>     foo = foldr union []

since foldr expects the function to have the signature
(a->b->b) it will use the union which matches it, which
will be the union :: [a] -> [a] -> [a] and not
union :: ( a -> a -> Bool) -> [a] -> [a] -> [a].

---
Kevin Atkinson
[EMAIL PROTECTED]
http://metalab.unc.edu/kevina/




Reply via email to