
5 Jun
2009
5 Jun
'09
11:37 a.m.
Geoffrey Marchant wrote:
The linked paper appears to show the right style.
This appears to satisfy the conditions, however:
inTwain as = let (x,y,_) = foldr (\a (r,s,t) -> case (t) of {b:(b':bs) -> (r,a:s,bs); _ -> (a:r,s,t)}) ([],[],as) as in (x,y)
This one is very interesting. Thanks. :-) It took a while to see what is going on. I'm not too happy with the whole list as part of the initial state. That feels like cheating to me--although I obviously failed to specify this in my original question. Trying to understand morphisms: does that make this a paramorphism rather than a catamorphism? Martijn.