diff options
author | Marvin Borner | 2023-03-05 16:28:58 +0100 |
---|---|---|
committer | Marvin Borner | 2023-03-05 16:28:58 +0100 |
commit | f5dc226df6ef8e5f257352409965603bbdaabd42 (patch) | |
tree | db9f656c9093df336c58f556139da01b4ca573c9 /src/Binary.hs | |
parent | ca808bc09373f123514bf865a4518bebac3bbbc3 (diff) |
Made stdin and argument conversion lazy
Diffstat (limited to 'src/Binary.hs')
-rw-r--r-- | src/Binary.hs | 4 |
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 |