> It only provides specialization of this definition, i.e. 
> fromRational and
> toRational dispatching is done at compile time (which, I hope, is done
> automatically anyway at least in cases where such function 
> gets inlined).
> 
> The compiler cannot guess that some primitive Float->Double 
> function can
> be used instead of going through Rational.

If enough inlining is done, then it should be able to deforest the
intermediate Rational and generate the same code.  But I agree, using RULES
here is quicker and doesn't rely on some hefty unfoldings.

Cheers,
        Simon

Reply via email to