Commit 98ed815f authored by Joachim Breitner's avatar Joachim Breitner

Make iterateFB inlineable

When investigating a case of unexpected Call Arity failure I noticed
that iterateFB would not inline as far as desired, as it is recursive.

This patch makes it non-recursive (with a local go), which seem so do
great good.
parent 3d6422b2
......@@ -352,7 +352,8 @@ iterate f x = x : iterate f (f x)
{-# NOINLINE [0] iterateFB #-}
iterateFB :: (a -> b -> b) -> (a -> a) -> a -> b
iterateFB c f x = x `c` iterateFB c f (f x)
iterateFB c f x0 = go x0
where go x = x `c` go (f x)
"iterate" [~1] forall f x. iterate f x = build (\c _n -> iterateFB c f x)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment