On 28 February 2012 17:06, Johan Holmquist <holmi...@gmail.com> wrote:
> Function 'withPair' takes a pair and applies a function to it's first > element, another function to it's second element and finally combines > the results with yet another function. > > withPair :: (a' -> b' -> c) -> (a -> a') -> (b -> b') -> (a,b) -> c > withPair f fa fb (a,b) = fa a `f` fb b > withPair is the Dovekie function from combinatory logic but with a pair for the non-combinator arguments (a,b) and the arg order changed to be more convenient to program with. There was a thread about inter[*] on the beginners list last month http://www.haskell.org/pipermail/beginners/2012-January/009329.html [*] or an inter-like function depending how you want to treat the initial value. I made a mistake with my suggestion. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe