~ajk/hbcd

9a8b29c92b27bf6f1993a9d3e4af1074a792faf3 — Andrew Kay 7 years ago 3b77d7f
Improved style of unpackBytes
1 files changed, 1 insertions(+), 1 deletions(-)

M src/Data/BCD/Packed.hs
M src/Data/BCD/Packed.hs => src/Data/BCD/Packed.hs +1 -1
@@ 40,7 40,7 @@ unpackByte b = [shiftR (b .&. 0xf0) 4, b .&. 0x0f]
-- | Unpack two digits from every byte in a ByteString resulting in a new ByteString twice
--   as long as the input
unpackBytes :: BS.ByteString -> BS.ByteString
unpackBytes bs = BS.concatMap (\b -> BS.pack $ unpackByte b) bs
unpackBytes bs = BS.concatMap (BS.pack . unpackByte) bs

-- | Encode the sign
encodeSign :: Integer -> Word8