
5 Jun
2007
5 Jun
'07
7:49 a.m.
| The rules do not fire. They only seem to fire if the specialized | function is called directly, such as | | > doSomethingWith ( zipWith (-) (u :: Vec Three Double) v ) That's probably because to fire distance must be inlined but sumV and mapV must not which is obviously a bit delicate. To do that you need fairly fine grain control over exactly when inlining takes place. That's what the [n] part of an INLINE pragma is for. Look in GHC.Base for examples. Don and Duncan are experts. I wish there was a more robust way to do this. Simon