HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulesnap-core-1.0.5.1Haskell2010

Snap.Internal.Parsing

  • 1 type
  • 43 values
  • Packagesnap-core-1.0.5.1
  • Exports44
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceParsing.hs
valuepTokens :: Parser [ByteString]
#

Used for "#field-name", and field-name = token, so "#token": comma-separated tokens/field-names, like a header field list.

typetype DList a = [a] -> [a]
#

Like printUrlEncoded, but produces a Builder instead of a ByteString. Useful for constructing a large string efficiently in a single step.

Example:

ghci> import Data.Map
ghci> import Data.Monoid
ghci> import Data.ByteString.Builder
ghci> let bldr = buildUrlEncoded (Data.Map.fromList [(Name, ["John Doe"]), (Age, ["23"])])
ghci> toLazyByteString $ byteString "http://example.com/script?" <> bldr
"http://example.com/script?Age=23&Name=John+Doe"

Given a collection of key-value pairs with possibly duplicate keys (represented as a Map), construct a string in application/x-www-form-urlencoded format.

Example:

ghci> printUrlEncoded (Data.Map.fromList [(Name, ["John Doe"]), (Age, ["23"])])
"Age=23&Name=John+Doe"