module Network.HTTP.Lucu.Parser.Http ( isCtl -- Char -> Bool , isSeparator -- Char -> Bool , token -- Parser Char ) where import qualified Data.ByteString.Lazy.Char8 as B import Data.ByteString.Lazy.Char8 (ByteString) import Data.List import Network.HTTP.Lucu.Parser isCtl :: Char -> Bool isCtl c | c < '\x1f' = True | c == '\x7f' = True | otherwise = False isSeparator :: Char -> Bool isSeparator c = elem c "()<>@,;:\\\"/[]?={} \t" token :: Parser Char token = satisfy (\ c -> not (isCtl c || isSeparator c))