On Thu, Feb 18, 2010 at 8:07 AM, Evan Laforge <qdun...@gmail.com> wrote:
> And BTW again, here's something I've occasionally found useful:
>
> -- | Handy to merge or sort a descending list.
> reverse_compare :: (Ord a) => a -> a -> Ordering
> reverse_compare a b = case compare a b of
>    LT -> GT
>    EQ -> EQ
>    GT -> LT

I wondered why there wasn't one of these in the standard library until
someone pointed out to me that

reverse_compare = flip compare

which actually takes fewer characters to type :P
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to