bits icon indicating copy to clipboard operation
bits copied to clipboard

Allow bits to be built for GHCJS

Open rjmac opened this issue 10 years ago • 3 comments

GHCJS doesn't support linking to C, naturally, so I made Data.Bits.Extras optionally use unsafeIndex into ByteStrings instead of linking to static C arrays.

Now that the tables exist in both C and Haskell, there is a generator script to produce them both so that the canonical list of magic numbers can be in only one place. Cabal doesn't really have great support (or indeed as far as I can tell, any support) for ad-hoc pre-build code generation like this, so it's a Python program with the outputs checked in.

rjmac avatar Dec 14 '14 16:12 rjmac