Build-Depends:
ascii == 0.0.*,
attempt == 0.3.*,
- attoparsec == 0.9.*,
+ attoparsec == 0.10.*,
base == 4.*,
base-unicode-symbols == 0.2.*,
base64-bytestring == 0.1.*,
template-haskell == 2.5.*,
text == 0.11.*,
time == 1.2.*,
- time-http == 0.3.*,
+ time-http == 0.4.*,
transformers == 0.2.*
if flag(ssl)
import Control.Monad
import Data.Ascii (Ascii, AsciiBuilder, CIAscii)
import qualified Data.Ascii as A
-import Data.Attoparsec.Char8 as P
+import Data.Attoparsec.Char8
import qualified Data.Collections.Newtype.TH as C
import Data.List (intersperse)
import qualified Data.Map as M (Map)
-}
headers ∷ Parser Headers
{-# INLINEABLE headers #-}
-headers = do xs ← P.many header
+headers = do xs ← many header
crlf
return $ fromFoldable xs
where
import Control.Monad.Unicode
import Data.Ascii (Ascii, CIAscii, AsciiBuilder)
import qualified Data.Ascii as A
-import Data.Attoparsec.Char8 as P
+import Data.Attoparsec.Char8
import Data.Bits
import qualified Data.ByteString.Char8 as BS
import Data.Char
-- |'Parser' for MIME parameter values.
mimeParams ∷ Parser MIMEParams
{-# INLINEABLE mimeParams #-}
-mimeParams = decodeParams =≪ P.many (try paramP)
+mimeParams = decodeParams =≪ many (try paramP)
paramP ∷ Parser ExtendedParam
paramP = do skipMany lws
encodedPayload ∷ Parser BS.ByteString
{-# INLINE encodedPayload #-}
-encodedPayload = BS.concat <$> P.many (hexChar <|> rawChars)
+encodedPayload = BS.concat <$> many (hexChar <|> rawChars)
hexChar ∷ Parser BS.ByteString
{-# INLINEABLE hexChar #-}
import Control.Monad
import Data.Ascii (Ascii)
import qualified Data.Ascii as A
-import Data.Attoparsec.Char8 as P hiding (scan)
-import qualified Data.Attoparsec.FastSet as FS
+import Data.Attoparsec.Char8
import qualified Data.ByteString.Char8 as BS
import Network.HTTP.Lucu.Parser
import Prelude.Unicode
-- separators.
isSeparator ∷ Char → Bool
{-# INLINE isSeparator #-}
-isSeparator = flip FS.memberChar set
- where
- {-# NOINLINE set #-}
- set = FS.charClass "()<>@,;:\\\"/[]?={}\x20\x09"
+isSeparator = inClass "()<>@,;:\\\"/[]?={}\x20\x09"
-- |@'isChar' c@ returns 'True' iff @c <= 0x7f@.
isChar ∷ Char → Bool
quotedStr ∷ Parser Ascii
{-# INLINEABLE quotedStr #-}
quotedStr = do void $ char '"'
- xs ← P.many (qdtext <|> quotedPair)
+ xs ← many (qdtext <|> quotedPair)
void $ char '"'
return ∘ A.unsafeFromByteString $ BS.pack xs
<?>