import qualified Data.Ascii as A
import Data.Attoparsec.Char8 as P
import qualified Data.Attoparsec.Lazy as LP
import qualified Data.Ascii as A
import Data.Attoparsec.Char8 as P
import qualified Data.Attoparsec.Lazy as LP
→ fail ("Failed to parse: " ⧺ fpath ⧺ ": " ⧺ e)
extMapP ∷ Parser [ (MIMEType, [Text]) ]
→ fail ("Failed to parse: " ⧺ fpath ⧺ ": " ⧺ e)
extMapP ∷ Parser [ (MIMEType, [Text]) ]
isSpc c = c ≡ '\x20' ∨ c ≡ '\x09'
comment ∷ Parser (Maybe (MIMEType, [Text]))
isSpc c = c ≡ '\x20' ∨ c ≡ '\x09'
comment ∷ Parser (Maybe (MIMEType, [Text]))
skipWhile isSpc
exts ← sepBy extP (skipWhile isSpc)
return $ Just (mime, exts)
skipWhile isSpc
exts ← sepBy extP (skipWhile isSpc)
return $ Just (mime, exts)
extP = decodeUtf8 <$> takeWhile1 (\c → (¬) (isSpc c ∨ c ≡ '\x0A'))
emptyLine ∷ Parser (Maybe (MIMEType, [Text]))
extP = decodeUtf8 <$> takeWhile1 (\c → (¬) (isSpc c ∨ c ≡ '\x0A'))
emptyLine ∷ Parser (Maybe (MIMEType, [Text]))
return Nothing
compile ∷ Ord k ⇒ [(v, [k])] → Either (k, v, v) (Map k v)
return Nothing
compile ∷ Ord k ⇒ [(v, [k])] → Either (k, v, v) (Map k v)