bracketOnError, while, forever

Tomasz Zielonka tomasz.zielonka at gmail.com
Wed Feb 9 14:47:43 EST 2005


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


More information about the Libraries mailing list