simonmar/monad-par — comment on commit 7a44b939da2e9f482ed05410a6a008e353f4a4c4
File:  line 0
By rrnewton:

The problem as far as I can tell was that deepseq had a certain instance (for Data.Map) in version 1.1 and then for whatever reason REMOVED it with 1.2. I hacked around with trying to force cholesky.hs to use 1.1 with a package import as you can see above:

import "deepseq-1.1.0.2" Control.DeepSeq

This apparently just didn't work. It would blithely take the 1.2 version if that was installed. I take it that "PackageImports" can select *packages* but not specific versions of packages.

Another approach would be to import Control.DeepSeq while "hiding" that particular instance -- but, alas!, there is no way to hide instances on import. Another dead-end.

One fix that may actually work would be to build these tests with cabal and force deepseq-1.1, or to use much more verbose -hide-all-packages and then add them in one at a time. But when I tried to force deepseq-1.1 with a couple simple "-package"/"-hide-package" flags (short of using -hide-all-packages) that didn't seem to work either. (A third dead-end.)

Finally, I think that comment above re: "overlapping instances" is incorrect. Overlapping instances can't fix the problem because Control.DeepSeq would have to ALSO be compiled with overlapping instances. (A fourth dead end.)

The way I actually fixed this was for monad-par.cabal to require deepseq >= 1.2. As long as it does that, and monad par is "cabal install"'d before building cholesky... everything should be fine.

-Ryan

P.S. Really, that benchmark has serious problems anyway. It was ported in a very literal way from a C++ benchmark and is litered with very dicey unsafePerformIOs. It would be nice if some interested party would rewrite it to use ST or something ;-). In the process, it would be possible to fix the above problem, for example, simply by "newtype"ing the relevant Matrix types.

P.P.S. Btw -- isn't the commit you linked to *this* commit?