Unless I misunderstood the problem, the following code will 'almost' do the
(first) job (misusing the first argument of showsPrec):
instance Show a => Show (Bind a) where
showsPrec n Zero = showInt n
showsPrec n (Succ x) = showsPrec (n+1) x
Works fine in Hugs 98 (with -98 as well as with
You don't have to define cpsfold explicitly recursively since it can be
expressed in terms of foldr:
cpsfold f a xs = foldr (\x k y -> f x y k) id xs a
The following definition would even be better (but not equivalent):
cpsfold' f a xs = foldr (\x k y -> f y x k) id xs a
The list members are
From: "Alastair Reid" <[EMAIL PROTECTED]>
>
> Gertjan Kamsteeg <[EMAIL PROTECTED]> writes:
> >> You don't have to define cpsfold explicitly recursively since it
> >> can be expressed in terms of foldr:
>
> Hal Daume III <[EMAIL PROT
Ok, here is an attempt. I don't have time to explain, but it's not Myer's
algorithm.
Try for example
diff "abcabba" "cbabac"
Gertjan Kamsteeg
data In a = F a | S a | B a
diff xs ys = steps ([(0,0,[],xs,ys)],[]) where
steps