From 6ae44d09faa0ae353c0818705503cad42127d102 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 3 Mar 2024 15:03:41 +0100 Subject: Even more samples wtf --- src/Helper.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Helper.hs') diff --git a/src/Helper.hs b/src/Helper.hs index 3c1f2f2..b4b48e1 100644 --- a/src/Helper.hs +++ b/src/Helper.hs @@ -365,7 +365,7 @@ humanifyString :: Expression -> Maybe String humanifyString e = do es <- unlistify e str <- mapM binaryToChar' es - pure $ show str + pure str humanifyPair :: Expression -> Maybe String humanifyPair e = do @@ -438,7 +438,7 @@ binaryToChar e = show <$> binaryToChar' e binaryToChar' :: Expression -> Maybe Char binaryToChar' e = do n <- binaryToDecimal' e - if n < 255 then Just $ chr $ fromIntegral n else Nothing + if n > 31 && n < 127 || n == 10 then Just $ chr $ fromIntegral n else Nothing binaryToDecimal' :: Expression -> Maybe Integer binaryToDecimal' e = do -- cgit v1.2.3