-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Labels
Description
We use loop structures to decode bytes:
littleEndianWord64 :: BS.ByteString -> Word64
littleEndianWord64 bytes =
foldr
(.|.)
0
( zipWith
(\b i -> fromIntegral b `shiftL` i)
(BS.unpack $ BS.take 8 bytes)
[0, 8 ..]
)These loops can be unrolled to something like https://hackage.haskell.org/package/binary-0.8.9.3/docs/src/Data.Binary.Get.html#word64be
Reactions are currently unavailable