Is there a change in strictness with the following transformation?  It seems
like scanr should be a good consumer and a good producer, intuitively.

scanrFB :: (a -> b -> b) -> b -> [a] -> (b -> c -> c) -> c -> c
scanrFB f x ls c n = snd (foldr (\ x (b, bs) -> let b' = f x b in (b', b'
`c` bs)) (x, n) ls)

{-# RULES
"scanr" [~1] forall f x l . scanr f x l = build (scanrFB f x l);
-# RULES}
-- 
Louis Wasserman
[EMAIL PROTECTED]
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to