
If you get stuck with fusion (but only then :-), ask me specifically and I’ll help.
Simon
From: Libraries [mailto:libraries-bounces@haskell.org] On Behalf Of Gabriel Gonzalez
Sent: 25 July 2013 18:56
To: Edward Kmett
Cc: libraries@haskell.org
Subject: Re: Data.Foldable causes missed foldr/build opportunities
On 07/25/2013 10:41 AM, Edward Kmett wrote:
One of the open concerns about it is definitely ensuring that we get the fusion opportunities we can.
If you put an INLINE pragma on your Foldable version of each do the fusion rules fire after it gets inlined into a call site that uses it as a list?
I tried both INLINE and INLINABLE and neither causes the fusion rules to fire. I also tried:
* adding an orphan SPECIALIZE rule for `Data.Foldable.mapM_` in the module where I defined `each`
* Specializing the type of `each` to consume lists, but still using the `Foldable` `mapM_`
* Defining a new copy of `each` (using the `Foldable` version) in the same module as the code that uses it, specializing the type signature to lists, and trying out INLINE/INLINABLE or no pragma.
None of those causes the rule to fire, either.
-Edward
On Thu, Jul 25, 2013 at 1:22 PM, Gabriel Gonzalez