[Haskell-cafe] Does somebody know about these functions?

Stephen Tetley stephen.tetley at gmail.com
Tue Feb 28 22:56:07 CET 2012

On 28 February 2012 17:06, Johan Holmquist <holmisen at 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


[*] or an inter-like function depending how you want to treat the
initial value. I made a mistake with my suggestion.

More information about the Haskell-Cafe mailing list