
9 Feb
2005
9 Feb
'05
2:47 p.m.
On Wed, Feb 09, 2005 at 11:50:48AM -0000, Simon Marlow wrote:
On 08 February 2005 12:33, Thomas Jäger wrote:
First of all
-- Cale Gibbard comparing :: (Ord a) => (b -> a) -> b -> b -> Ordering comparing p x y = compare (p x) (p y) fits nicely with the ...By functions from Data.List.
sortBy (comparing fst)
is just too cute not to have. Any objections?
How about a more general function: composeFGxGy :: (b -> b -> c) -> (a -> b) -> a -> a -> c composeFGxGy f g x y = f (g x) (g y) Best regards Tomasz -- Szukamy programisty C++ i Haskell'a: http://tinyurl.com/5mw4e