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/
- Re: To all those who don't like ad-hoc overlo... Scott Turner
- Re: To all those who don't like ad-hoc overlo... Matt Harden
- Re: To all those who don't like ad-hoc overlo... Manuel M. T. Chakravarty
- Re: To all those who don't like ad-hoc overlo... Kevin Atkinson
- Re: To all those who don't like ad-hoc overlo... Manuel M. T. Chakravarty
- Re: To all those who don't like ad-hoc overlo... Jan de Wit
- Re: To all those who don't like ad-hoc overlo... Adrian Hey
- Re: To all those who don't like ad-hoc overlo... Kevin Atkinson
- Re: To all those who don't like ad-hoc overlo... Kevin Atkinson
- Re: To all those who don't like ad-hoc overlo... Joe English
- Re: To all those who don't like ad-hoc overlo... Kevin Atkinson
- Re: To all those who don't like ad-hoc overlo... Mariano Suarez Alvarez
- Re: To all those who don't like ad-hoc overlo... Kevin Atkinson
- Re: To all those who don't like ad-hoc overlo... Carlos Camarao de Figueiredo
- Re: To all those who don't like ad-hoc overlo... Carlos Camarao de Figueiredo