bbv icon indicating copy to clipboard operation
bbv copied to clipboard

Extracting [hexDigitToN] in Haskell creates Data.Bits.testBit and Data.Char.ord

Open vmurali opened this issue 7 years ago • 1 comments

Since the generated Haskell does not import Data.Bits.testBit and Data.Char.ord, the overall compilation of the Haskell program fails. Any ideas to avoid generating these functions during Extraction?

vmurali avatar Jul 06 '18 00:07 vmurali

It looks like there's no option to specify additional imports to be put at the top of the generates haskell files, so you'd have to add the required imports yourself afterwards (eg like Tej).

But maybe if you're lucky you could just use something like Extract Constant Ox => someHaskellCode, where someHaskellCode only uses functions imported by default and converts a hex sring to an int, maybe using readHex?

samuelgruetter avatar Jul 06 '18 10:07 samuelgruetter