Joachim Breitner wrote:
Hi,
Am Samstag, den 10.03.2007, 14:52 -0500 schrieb Stefan Monnier:
I'm pretty sure you can define a catamorphism for any regular algebraic
data type.
Actually, so-called negative occurrences in (regular) data types cause
problems. Try to define the catamorphism of
When you make these kind of elimination functions you have a choice.
Namely if you want to do case analysis only, or primitive recursion.
For non-recursive data types they come out the same, so 'maybe',
'either',
'uncurry', etc are the same. But for lists it differs:
-- Case analysis
caseList
Hi,
Am Samstag, den 10.03.2007, 14:52 -0500 schrieb Stefan Monnier:
> > I'm pretty sure you can define a catamorphism for any regular algebraic
> > data type.
>
> Actually, so-called negative occurrences in (regular) data types cause
> problems. Try to define the catamorphism of
>
> data Ex
> I'm pretty sure you can define a catamorphism for any regular algebraic
> data type.
Actually, so-called negative occurrences in (regular) data types cause
problems. Try to define the catamorphism of
data Exp = Num Int | Lam (Exp -> Exp) | App Exp Exp
to see the problem,
Stefan