Re: [Haskell-cafe] Distributing monadic(?) functions across dyadic functions

2006-04-03 Thread Nils Anders Danielsson
On Sun, 02 Apr 2006, Jared Updike [EMAIL PROTECTED] wrote: Something like distribute fst (==) where distribute f op x y = f x `op` f y A function like this has been suggested for the standard libraries a couple of times before. Someone suggested the name on, which I quite like: (*) `on` f

[Haskell-cafe] Distributing monadic(?) functions across dyadic functions

2006-04-03 Thread tpledger
Nils Anders Danielsson wrote: A function like this has been suggested for the standard libraries a couple of times before. Someone suggested the name on, which I quite like: (*) `on` f = \x y - f x * f y Thanks! I always wanted to be someone. :-) Here's the link.

[Haskell-cafe] Distributing monadic(?) functions across dyadic functions

2006-04-02 Thread Jared Updike
Is there a common way (standard libs, higher order) to express the lambda part below? It's not particulary complicated but I think it is not higher-order enough unionBy (\x y - fst x == fst y) listOfPairs1 listOfPairs2 Something like distribute fst (==) where distribute f op x y = f x `op` f

Re: [Haskell-cafe] Distributing monadic(?) functions across dyadic functions

2006-04-02 Thread David Menendez
Jared Updike writes: Is there a common way (standard libs, higher order) to express the lambda part below? It's not particulary complicated but I think it is not higher-order enough unionBy (\x y - fst x == fst y) listOfPairs1 listOfPairs2 Something like distribute fst (==) where

Re: [Haskell-cafe] Distributing monadic(?) functions across dyadic functions

2006-04-02 Thread Dean Herington
At 11:58 AM -0700 4/2/06, Jared Updike wrote: Is there a common way (standard libs, higher order) to express the lambda part below? It's not particulary complicated but I think it is not higher-order enough unionBy (\x y - fst x == fst y) listOfPairs1 listOfPairs2 Something like distribute