aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Binary.hs
diff options
context:
space:
mode:
authorMarvin Borner2023-03-05 16:28:58 +0100
committerMarvin Borner2023-03-05 16:28:58 +0100
commitf5dc226df6ef8e5f257352409965603bbdaabd42 (patch)
treedb9f656c9093df336c58f556139da01b4ca573c9 /src/Binary.hs
parentca808bc09373f123514bf865a4518bebac3bbbc3 (diff)
Made stdin and argument conversion lazy
Diffstat (limited to 'src/Binary.hs')
-rw-r--r--src/Binary.hs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/Binary.hs b/src/Binary.hs
index ac08ca7..a9e8028 100644
--- a/src/Binary.hs
+++ b/src/Binary.hs
@@ -10,7 +10,6 @@ import Data.Binary ( decode
, encode
)
import qualified Data.BitString as Bit
-import qualified Data.ByteString.Lazy as Byte
import Data.Word ( Word8 )
import Helper
@@ -43,8 +42,7 @@ fromBinary = fst . fromBinary'
-- TODO: technically only 1 nibble is needed (use other nibble for versioning/sth?)
toBitString :: String -> Bit.BitString
toBitString str = Bit.concat
- [ Bit.bitString $ Byte.toStrict $ encode
- (fromIntegral $ length str `mod` 8 :: Word8)
+ [ Bit.bitStringLazy $ encode (fromIntegral $ length str `mod` 8 :: Word8)
, Bit.fromList $ map
(\case
'0' -> False