Commit 78053f44 authored by Joachim Breitner's avatar Joachim Breitner

Allow enumDeltaIntegerFB to be inlined

The function is very small and the compiler should be at liberty to
inline it. But it is recursive, so it did not do it before. By applying
the usual transformation with a local recursive function, GHC can now
inline it, producing the loop that one would expect.
parent b4d43b4e
......@@ -704,7 +704,8 @@ the special case varies more from the general case, due to the issue of overflow
{-# NOINLINE [0] enumDeltaIntegerFB #-}
enumDeltaIntegerFB :: (Integer -> b -> b) -> Integer -> Integer -> b
enumDeltaIntegerFB c x d = x `seq` (x `c` enumDeltaIntegerFB c (x+d) d)
enumDeltaIntegerFB c x d = go x
where go x = x `seq` (x `c` go (x+d))
{-# NOINLINE [1] enumDeltaInteger #-}
enumDeltaInteger :: Integer -> Integer -> [Integer]
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment