Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with integer-simple #135

Closed
nh2 opened this issue Aug 22, 2018 · 1 comment · Fixed by #147
Closed

Compatibility with integer-simple #135

nh2 opened this issue Aug 22, 2018 · 1 comment · Fixed by #147

Comments

@nh2
Copy link

nh2 commented Aug 22, 2018

Currently store hard-depends on integer-gmp. Its .Internal module is used.

integer-gmp implies gmp which is LGPL which means currently store cannot be used to statically link proprietary products.

It would be great if store could offer a flag to use integer-simple instead, like text (via its integer-simple flag) and cryptonite (via its integer-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 for integer-simple?

@mgsloan
Copy link
Owner

mgsloan commented Aug 22, 2018

@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)  

cocreature added a commit to cocreature/store that referenced this issue Nov 6, 2019
cocreature added a commit to cocreature/store that referenced this issue Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants