RE: specialization using RULES

2007-06-05 Thread Simon Peyton-Jones
| 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

specialization using RULES

2007-06-04 Thread Scott Dillard
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

Specialization and complicated (?) types

2000-03-28 Thread Carsten Schultz
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

RE: specialization with =

1999-02-17 Thread Simon Peyton-Jones
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

specialization with =

1999-02-15 Thread S.D.Mechveliani
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

Re: specialization

1997-04-08 Thread Simon L Peyton Jones
| 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