Gabriella439/foldl

Add support for `Scan`

Closed this issue · 1 comments

Fold : foldl :: Scan : mapAccumL

data Scan a b  = forall x. Scan (x -> a -> (x, b)) x

prescan and postscan along aren't good enough because there's no way to recover the identity Scan:

id :: Scan a a
id = Scan (\()-> \a -> ((), a)) () 

#28 (comment) Ah I see you thought of this too. I have started working on this. I'll finish it if you want it.