bracketOnError, while, forever

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Mon Mar 14 06:56:16 EST 2005


"Simon Marlow" <simonmar at microsoft.com> writes:

> >>>> comparing :: (Ord a) => (b -> a) -> b -> b -> Ordering
> >>>> comparing p x y = compare (p x) (p y)
> >> 
> >>  sortBy (comparing fst)
> >> 
> >> is just too cute not to have.  Any objections?
> 
> Just attempting to empty my inbox... we never resolved this one.  Perhaps
> there should be Data.Ord (and Data.Eq for that matter), and then we'd have
> an obvious place to put comparing?

Seems OK to me.  I couldn't find an existing definition of the Eq or
Ord class anywhere in the base package - is it currently only in the
haskell98 Prelude?

Regards,
    Malcolm


More information about the Libraries mailing list