33
44module HaskellWorks.Data.Xml.Internal.List
55 ( blankedXmlToInterestBits
6- , byteStringToBits
76 , compressWordAsBit
87 ) where
98
@@ -14,9 +13,7 @@ import HaskellWorks.Data.Xml.Internal.ByteString
1413import HaskellWorks.Data.Xml.Internal.Tables
1514import Prelude
1615
17- import qualified Data.Bits as BITS
1816import qualified Data.ByteString as BS
19- import qualified Prelude as P
2017
2118blankedXmlToInterestBits :: [ByteString ] -> [ByteString ]
2219blankedXmlToInterestBits = blankedXmlToInterestBits' " "
@@ -59,23 +56,3 @@ compressWordAsBit' aBS iBS = case iBS of
5956 else Just ( BS. foldr' (\ b m -> ((b .&. 1 ) .|. (m .<. 1 ))) 0 (BS. take 8 xs)
6057 , BS. drop 8 xs
6158 )
62-
63- yieldBitsOfWord8 :: Word8 -> [Bool ]
64- yieldBitsOfWord8 w =
65- [ (w .&. BITS. bit 0 ) /= 0
66- , (w .&. BITS. bit 1 ) /= 0
67- , (w .&. BITS. bit 2 ) /= 0
68- , (w .&. BITS. bit 3 ) /= 0
69- , (w .&. BITS. bit 4 ) /= 0
70- , (w .&. BITS. bit 5 ) /= 0
71- , (w .&. BITS. bit 6 ) /= 0
72- , (w .&. BITS. bit 7 ) /= 0
73- ]
74-
75- yieldBitsofWord8s :: [Word8 ] -> [Bool ]
76- yieldBitsofWord8s = P. foldr ((++) . yieldBitsOfWord8) []
77-
78- byteStringToBits :: [ByteString ] -> [Bool ]
79- byteStringToBits is = case is of
80- (bs: bss) -> yieldBitsofWord8s (BS. unpack bs) ++ byteStringToBits bss
81- [] -> []
0 commit comments