Allow bits to be built for GHCJS
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.
7 years later I suppose I should probably merge this. ;)
Heh, maybe. GHCJS isn't super important to me anymore, alas, but maybe it'd be useful for someone!
I worry that some of bits' dependencies have become unbuildable on GHCJS in the meantime. For example, bytes now depends on C code as of ekmett/bytes@ce5a26d31ee57da2390db0bb63293d9e6f7280fd. If anyone needs GHCJS support for bits, I'd encourage them to pick up this work, but I think we may need to fix some of the dependencies first.