implemented stripCRLF
This commit is contained in:
@@ -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