| 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
dimensionality of
the vectors at the type level, so you could not add a two-vector to a
three-vector, even though both functions are just zipWith (+).
After trying to tune my library I came across the SPECIALIZATION/RULES
pagmas in the GHC manual, and thought that this phantom dimensionality
type
Hallo everyone,
I have a problem concerning the performance of a program and have started suspecting that GHC's optimiser is confused by my types.
I have the following modules, types, and functions:
module MatrixSparse :
data Num a => Vector a = ...
data Num a => STMatrix s a = STMat !Int
SPECIALIZE with '=' is very desirable.
Otherwise, how can one denote with the same name a function together
with its particularly efficient specialization?
Yes it's desirable. I'm not sure how soon we'll get to it
unless other people start yelling too!
In general, expect a quiet patch
pecialiser.
SPECIALIZE with '=' is very desirable.
Otherwise, how can one denote with the same name a function together
with its particularly efficient specialization?
If i knew of this `=' possibility, i would have raised the noise two
years earlier.
Second question: is this hard to implement speci
| What I'd really like is a command "specialize module Foo for type Bar",
| and moreover, this specialization should happen completely outside
| the text of module Foo. (Compare to an instanciation of a generic
| package in Ada.)
|
| Are there any magic ghc options/perl scr