2-- Convert Haskell values to and from HTTP API data
3-- such as URL pieces, headers and query parameters.
4module Web.HttpApiData (
12 -- * @'Maybe'@ parsers
18 parseUrlPieceWithPrefix,
19 parseHeaderWithPrefix,
20 parseQueryParamWithPrefix,
22 -- * Multiple URL pieces
32import Web.HttpApiData.Internal
36-- >>> :set -XOverloadedStrings
37-- >>> import Control.Applicative
38-- >>> import Data.Time
40-- >>> import Data.Text (Text)
41-- >>> import Data.Time (Day)
42-- >>> import Data.Version
50-- >>> parseUrlPiece "false" :: Either Text Bool
52-- >>> parseUrlPiece "something else" :: Either Text Bool
53-- Left "could not parse: `something else'"
59-- >>> parseUrlPiece "452" :: Either Text Int
61-- >>> parseUrlPiece "256" :: Either Text Int8
62-- Left "out of bounds: `256' (should be between -128 and 127)"
66-- >>> toHeader "hello"
68-- >>> parseHeader "world" :: Either Text String
73-- >>> toQueryParam (fromGregorian 2015 10 03)
75-- >>> toGregorian <$> parseQueryParam "2016-12-01"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list