[Haskell-cafe] CPS versus Pattern Matching performance

Bruno Oliveira bruno.oliveira at comlab.ox.ac.uk
Tue Jul 10 05:07:57 EDT 2007


Hello,

On Tue, 10 Jul 2007 10:53:35 +0200 (MEST), Henning Thielemann wrote:


>On Tue, 10 Jul 2007, Tony Morris wrote:

>> Is your explanation specific to maybe? Or does that apply to all functions?
>>
>> Suppose the following function for lists:
>>
>> f :: [a] -> b -> (a -> [a] -> b) -> b
>>
>> ...instead of pattern matching [] and (x:xs)

>A foldr without recursion. I use such functions frequently in order to
>hide constructors of a data type. Does this kind of functions has a common
>name?

I think they just called "case analysis"; at least that's the terminology used here:

http://www.dcs.st-andrews.ac.uk/~james/RESEARCH/concon.pdf

(See the "treeCase" example in Section 3).

Cheers,

Bruno Oliveira




More information about the Haskell-Cafe mailing list