implemented stripCRLF
This commit is contained in:
1 parent
05e83857a7
commit
391ffd3eea
2 files changed
+26
-5
No files matched your search
@@ -132,7 +132,10 @@ readMax maxLen conn = do
|
||||
-- | Strips the CR/LF characters from the end of a string, retuning
|
||||
-- Nothing if they are not present
|
||||
stripCRLF :: String -> Maybe String
|
||||
stripCRLF = undefined
|
||||
stripCRLF = \case
|
||||
"" -> Nothing
|
||||
"\r\n" -> Just ""
|
||||
c:str -> (c:) <$> stripCRLF str
|
||||
|
||||
readLoop :: Int -> S.InputStream BS.ByteString -> MaybeT IO Builder
|
||||
readLoop maxLen src = lift (S.read src) >>= \case
|
||||
|
||||
Reference in new issue
Block a user