
26 Oct
2007
26 Oct
'07
6:47 p.m.
On 10/26/07, Brent Yorgey
In the end it looks to me like you're probably better off just implementing traverse directly as you have done, although perhaps someone will find a better way.
Beginner's luck. ;-) I see the unfold similarity, but yes, it doesn't seem a good fit here.
I will note, however, that the last few lines of traverse can be written more simply as: Just v -> liftM (v:) . valve . traverse $ (\db -> nextKey db v) or even Just v -> liftM (v:) . valve . traverse . flip nextKey $ v
Perhaps that's going too far for your taste...
Not at all -- it's terse but the data flow is clear. Thanks very much, Graham