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
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.
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
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
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