Closed nh2 closed 4 years ago
@nh2 Hey, good idea! Probably pretty easy, though a little bit of boilerplate. Would be nice if the TH generation would work for it, but it is using unboxed types, so they'll need to be re-wrapped. So, for example, the definition of poke would probably be something like this untested / uncompiled code:
poke = \case
S# x -> poke (0 :: Word8) >> poke (I# x)
Jp# (BN# x) -> poke (1 :: Word8) >> poke (ByteArray x)
Jn# (BN# x) -> poke (2 :: Word8) >> poke (ByteArray x)
Currently
store
hard-depends oninteger-gmp
. Its.Internal
module is used.integer-gmp
impliesgmp
which is LGPL which means currentlystore
cannot be used to statically link proprietary products.It would be great if
store
could offer a flag to useinteger-simple
instead, liketext
(via itsinteger-simple
flag) andcryptonite
(via itsinteger-gmp
flag) do.Could somebody estimate how much effort it would be to write the code that currently uses
import qualified GHC.Integer.GMP.Internals as I
forinteger-simple
?