Keith Battocchi wrote:
data Nest a = Nil | Cons(a, (Nest (Pair a)))
type Pair a = (a,a)
pair f (a,b) = (f a, f b)
efold :: forall n m b.
(forall a. n a)
- (forall a . (m a, n (Pair a)) - n a)
- (forall a. Pair (m a) - m (Pair a))
- (forall l z. (l b - m (z b)) - Nest (l b) -
On Fri, Apr 24, 2009 at 06:52:09PM +, Keith Battocchi wrote:
I'm trying to write some code to do folds on nested datatypes as in
http://web.comlab.ox.ac.uk/people/Jeremy.Gibbons/publications/efolds.pdf but
running into trouble getting things to typecheck.
Given the types
data Nest a
I'm trying to write some code to do folds on nested datatypes as in
http://web.comlab.ox.ac.uk/people/Jeremy.Gibbons/publications/efolds.pdf but
running into trouble getting things to typecheck.
Given the types
data Nest a = Nil | Cons(a, (Nest (Pair a)))
type Pair a = (a,a)
and the following