Closed tau3 closed 5 years ago
P.S. diff shows realy huuuuge changeset because of hindent (default setup). If a special profile is used in Arithmoi, please, point me at so i can reduce the number of changed lines.
@tau3 when you run cabal repl
or cabal new-repl
, simply pass -fobject-code
as a GHC option:
cabal (new-)repl --ghc-options=-fobject-code
This goes for any other GHC option(s) you may wish to pass to a GHCi session.
Cabal suggested to specify -fobject-code, but i couldn't google anything about that flag.
P.S. diff shows realy huuuuge changeset because of hindent (default setup). If a special profile is used in Arithmoi, please, point me at so i can reduce the number of changed lines.
I do not use hindent
for artithmoi
, so no agreed profile exists. We can discuss indentation profile as a separate issue, but in course of this PR I am not keen to review thousand lines. Please commit only non-whitespace changes. You can do it as suggested at https://stackoverflow.com/a/7149602 plus several manual tweaks.
@Bodigrim thanks for advices, but unfortunatelly git diff ... -U0 -w ...
didn't do the trick with spaces in this case :disappointed:
also i encountered some weird vector bounds errors during debug (debugging itself was kinda stressing due to inability to work with unboxed code in interpreter mode).
probably this refactoring attempt should be considered as unseccessful.
@rockbmb thank you and good luck with yours!)
@tau3 don't call it unsuccessful just yet! You don't have to do everything at once.
You can just pick a module that is all four of:
Array
s instead of Vector
sand make the necessary refactoring. It won't be too difficult, and remember that after it compiles you have a friend in cabal (new-)test
.
+1 to @rockbmb
It may be tough to migrate prime sieves from array
to vector
, but migration of other modules is also highly appreciated.
well, there is an option to contain methods for both arrays and vectors in Unsafe module, so the issue could be solved step-by-step.
Closing due to the lack of activity. Anyway thanks for you efforts!
Hello!
Here is the initial implementation of migration from arrays to vectors (#79) It compiles but fails against some of unit tests. To figure out the root cause, i recompiled sources with enabled
check-bounds
Yep, seems like most of exceptions were 'index of bounds'. I wanted to debug incabal-repl
, but it failed to load due toError: bytecode compiler can't handle unboxed tuples and sums.
Cabal suggested to specify-fobject-code
, but i couldn't google anything about that flag.So, some assistance is required :)