[Haskell-cafe] fast Eucl. dist. - Haskell vs C

Don Stewart dons at galois.com
Mon May 18 14:34:15 EDT 2009


claus.reinke:
>>> Once I actually add a 'dist_fast_inline_caller', that indirection   
>>> disappears in the inlined code, just as it does for dist_fast itself.
>>>
>>>    dist_fast_inlined_caller :: UArr Double -> UArr Double -> Bool
>>>    dist_fast_inlined_caller p1 p2 = dist_fast_inlined p1 p2 > 2
>>>
>>> However, in the simpl output for 'dist_fast_inline_caller', the
>>> 'sumU' and 'zipWithU' still don't seem to be fused - Don?
>>
>> All the 'seq's and so on should be unnecessary, and even so, I still get
>> the expected fusion:
>
> As I said, I don't get the fusion if I just add the function above to the 
> original Dist.hs, export it and compile the module with '-c -O2 
> -ddump-simpl':

I can't reproduce this.

Does the complete program fragment I posted earlier yield the desired
result?

-- Don


More information about the Haskell-Cafe mailing list