, quoteStr
, parseWWWFormURLEncoded
, splitPathInfo
- , show3
, trim
, liftCIAscii
, liftText
, liftMap
)
where
-import Blaze.ByteString.Builder.ByteString as B
-import Blaze.Text.Int as BT
import Control.Monad
import Data.Ascii (Ascii, CIAscii, AsciiBuilder)
import qualified Data.Ascii as A
in
map BS.pack reqPath
--- |>>> show3 5
--- "005"
-show3 ∷ Integral n ⇒ n → AsciiBuilder
-{-# INLINEABLE show3 #-}
-show3 = A.unsafeFromBuilder ∘ go
- where
- go i | i ≥ 0 ∧ i < 10 = B.fromByteString "00" ⊕ BT.digit i
- | i ≥ 0 ∧ i < 100 = B.fromByteString "0" ⊕ BT.integral i
- | i ≥ 0 ∧ i < 1000 = BT.integral i
- | otherwise = error ("show3: the integer i must satisfy 0 <= i < 1000: " ⧺ show i)
--- FIXME: Drop this function as soon as possible, to eliminate the
--- dependency on blaze-textual.
-
-- |>>> trim " ab c d "
-- "ab c d"
trim ∷ String → String