h$e^O      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None  .35679>,D http-api-dataLenient parameters.  combinators always return . http-api-dataParse value from HTTP API data.WARNING: Do not derive this using DeriveAnyClass3 as the generated instance will loop indefinitely. http-api-dataParse URL path piece. http-api-dataParse HTTP header value. http-api-dataParse query param value. http-api-dataConvert value to HTTP API data.WARNING: Do not derive this using DeriveAnyClass3 as the generated instance will loop indefinitely. http-api-dataConvert to URL path piece.  http-api-dataConvert to a URL path piece, making sure to encode any special chars. The default definition uses ;, but this may be overriden with a more efficient version.  http-api-dataConvert to HTTP header value.  http-api-dataConvert to query param value.  http-api-data0Convert multiple values to a list of URL pieces.toUrlPieces [1, 2, 3] :: [Text] ["1","2","3"]  http-api-dataParse multiple URL pieces.6parseUrlPieces ["true", "false"] :: Either Text [Bool]Right [True,False]=parseUrlPieces ["123", "hello", "world"] :: Either Text [Int]Left "could not parse: `hello' (input does not start with a digit)" http-api-data parseUrlPieceWithPrefix "Foo " s(parseUrlPiece "foo 1" :: Either Text Foo Right (Foo 1) http-api-data>Parse given bytestring then parse the rest of the input using . data BasicAuthToken = BasicAuthToken Text deriving (Show) instance FromHttpApiData BasicAuthToken where parseHeader h = BasicAuthToken <$> parseHeaderWithPrefix "Basic " h parseQueryParam p = BasicAuthToken <$> parseQueryParam p parseHeader "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" :: Either Text BasicAuthToken5Right (BasicAuthToken "QWxhZGRpbjpvcGVuIHNlc2FtZQ==") http-api-dataCase insensitive.Parse given text case insensitive and then parse the rest of the input using .6parseQueryParamWithPrefix "z" "z10" :: Either Text IntRight 10 http-api-dataCase insensitive.)Parse values case insensitively based on  instance./parseBoundedTextData "true" :: Either Text Bool Right True0parseBoundedTextData "FALSE" :: Either Text Bool Right FalseThis can be used as a default implementation for enumeration types: this instance works correctly for alphanumeric name and valuelet Right c = parseUrlPiece "SESSID=r2t5uvjq435r4q7ib3vtdjq120" :: Either Text SetCookie toUrlPiece c#"SESSID=r2t5uvjq435r4q7ib3vtdjq120" toHeader c#"SESSID=r2t5uvjq435r4q7ib3vtdjq120", http-api-data,toUrlPiece (Left "err" :: Either String Int) "left err")toUrlPiece (Right 3 :: Either String Int) "right 3"- http-api-datatoUrlPiece (Just "Hello") "just Hello"= http-api-data3import Data.Time.Calendar.Month.Compat (Month (..)) MkMonth 244822040-03toUrlPiece $ MkMonth 24482 "2040-03"> http-api-data7import Data.Time.Calendar.Quarter.Compat (Quarter (..))MkQuarter 80402010-Q1toUrlPiece $ MkQuarter 8040 "2010-q1"? http-api-data toUrlPiece Q4"q4"@ http-api-datatoUrlPiece Monday"monday"A http-api-data5toUrlPiece $ UTCTime (fromGregorian 2015 10 03) 864.5"2015-10-03T00:14:24.5Z"B http-api-datatoUrlPiece $ ZonedTime (LocalTime (fromGregorian 2015 10 03) (TimeOfDay 14 55 51.001)) utc"2015-10-03T14:55:51.001+0000"C http-api-datatoUrlPiece $ LocalTime (fromGregorian 2015 10 03) (TimeOfDay 14 55 21.687)"2015-10-03T14:55:21.687"D http-api-data!toUrlPiece $ TimeOfDay 14 55 23.1 "14:55:23.1"E http-api-data%toUrlPiece (fromGregorian 2015 10 03) "2015-10-03"F http-api-data%Note: this instance is not polykindedX http-api-data!toUrlPiece (Version [1, 2, 3] [])"1.2.3"Z http-api-data toUrlPiece ()"_"[ http-api-data\ http-api-data] http-api-data%Note: this instance is not polykinded^ http-api-dataNote:> this instance works correctly for alphanumeric name and valueparseUrlPiece "SESSID=r2t5uvjq435r4q7ib3vtdjq120" :: Either Text SetCookieRight (SetCookie {setCookieName = "SESSID", setCookieValue = "r2t5uvjq435r4q7ib3vtdjq120", setCookiePath = Nothing, setCookieExpires = Nothing, setCookieMaxAge = Nothing, setCookieDomain = Nothing, setCookieHttpOnly = False, setCookieSecure = False, setCookieSameSite = Nothing})` http-api-data parseUrlPiece "2016-12-01"Right (2016,12,1)w http-api-data%Note: this instance is not polykinded http-api-data Parsing a ' value is always an error, considering % as a data type with no constructors. http-api-data%showVersion <$> parseUrlPiece "1.2.3" Right "1.2.3" http-api-data#parseUrlPiece "_" :: Either Text ()Right ()'   !"#$%&'   !"#$%&None -./89>?\& http-api-data-based deriving options for  and ."A common use case for non-default + is to strip a prefix off of field labels: data Project = Project { projectName :: String , projectSize :: Int } deriving (, ) myOptions ::  myOptions =  {  =  toLower .  ( "project") } instance  Project where  =  myOptions instance  Project where  =  myOptions urlEncodeAsFormStable Project { projectName = "http-api-data", projectSize = 172 }"name=http-api-data&size=172"urlDecodeAsForm "name=http-api-data&size=172" :: Either Text ProjectRight (Project {projectName = "http-api-data", projectSize = 172}) http-api-dataFunction applied to field labels. Handy for removing common record prefixes for example. http-api-dataParse  into a value.An example type and instance: data Person = Person { name :: String , age :: Int } instance  Person where  f = Person   "name" f   "age" f Instead of manually writing < instances you can use a default generic implementation of .To do that, simply add  deriving ( clause to your datatype and declare a ; instance for your datatype without giving definition for .?For instance, the previous example can be simplified into this: data Person = Person { name :: String , age :: Int } deriving ( ) instance  Person The default implementation of  is -. It only works for records and it will use  for each field's value. http-api-dataParse  into a value. http-api-dataConvert a value into .An example type and instance: {-# LANGUAGE OverloadedLists #-} data Person = Person { name :: String , age :: Int } instance  Person where  person = [ ("name",   (name person)) , ("age",   (age person)) ] Instead of manually writing < instances you can use a default generic implementation of .To do that, simply add  deriving ( clause to your datatype and declare a ; instance for your datatype without giving definition for .?For instance, the previous example can be simplified into this: data Person = Person { name :: String , age :: Int } deriving ( ) instance  Person The default implementation of  is . http-api-dataConvert a value into . http-api-data,The contents of a form, not yet URL-encoded. can be URL-encoded with  and URL-decoded with . http-api-data6Typeclass for types that can be parsed from keys of a . This is the reverse of . http-api-dataParse a key of a . http-api-data2Typeclass for types that can be used as keys in a -like container (like ). http-api-dataRender a key for a . http-api-dataA stable version of . http-api-data1Convert a list of entries groupped by key into a .=fromEntriesByKey [("name",["Nick"]),("color",["red","blue"])];fromList [("color","red"),("color","blue"),("name","Nick")] http-api-dataA -based implementation of /. This is used as a default implementation in .Note that this only works for records (i.e. product data types with named fields): data Person = Person { name :: String , age :: Int } deriving () =In this implementation each field's value gets encoded using  ". Two field types are exceptions:for values of type  a an entry is added to the  only when it is  x and the encoded value is   x;  values are omitted from the ;for values of type [a] (except []) an entry is added for every item in the list; if the list is empty no entries are added to the ;Here's an example: data Post = Post { title :: String , subtitle :: Maybe String , comments :: [String] } deriving (,  ) instance  Post urlEncodeAsFormStable Post { title = "Test", subtitle = Nothing, comments = ["Nice post!", "+1"] }2"comments=Nice%20post%21&comments=%2B1&title=Test" http-api-dataParse a ( into a list of entries groupped by key._NOTE:_ this conversion is unstable and may result in different key order (but not values). For a stable encoding see . http-api-dataParse a ( into a list of entries groupped by key.toEntriesByKeyStable [("name", "Nick"), ("color", "red"), ("color", "white")] :: Either Text [(Text, [Text])]3Right [("color",["red","white"]),("name",["Nick"])],For an unstable (but faster) conversion see . http-api-dataA -based implementation of /. This is used as a default implementation in .Note that this only works for records (i.e. product data types with named fields): data Person = Person { name :: String , age :: Int } deriving () =In this implementation each field's value gets decoded using ". Two field types are exceptions:for values of type  a& an entry is parsed if present in the  and the is decoded with #; if no entry is present result is ;for values of type [a] (except []<) all entries are parsed to produce a list of parsed values;Here's an example: data Post = Post { title :: String , subtitle :: Maybe String , comments :: [String] } deriving (,  ) instance  Post urlDecodeAsForm "comments=Nice%20post%21&comments=%2B1&title=Test" :: Either Text PostRight (Post {title = "Test", subtitle = Nothing, comments = ["Nice post!","+1"]}) http-api-data Encode a  to an !application/x-www-form-urlencoded ._NOTE:_ this encoding is unstable and may result in different key order (but not values). For a stable encoding see . http-api-data Encode a  to an !application/x-www-form-urlencoded .*For an unstable (but faster) encoding see .Key-value pairs get encoded to  key=value and separated by &:>urlEncodeFormStable [("name", "Julian"), ("lastname", "Arni")]"lastname=Arni&name=Julian"+Keys with empty values get encoded to just key (without the = sign):%urlEncodeFormStable [("is_test", "")] "is_test"Empty keys are allowed too:$urlEncodeFormStable [("", "foobar")] "=foobar"However, if both key and value are empty, the key-value pair is ignored. (This prevents  .  from being a true isomorphism).urlEncodeFormStable [("", "")]""Everything is escaped with escapeURIString  isUnreserved:0urlEncodeFormStable [("fullname", "Andres Lh")]"fullname=Andres%20L%C3%B6h" http-api-data'Encode a list of key-value pairs to an !application/x-www-form-urlencoded . See also . http-api-data Decode an !application/x-www-form-urlencoded  to a .%Key-value pairs get decoded normally:(urlDecodeForm "name=Greg&lastname=Weber"7Right (fromList [("lastname","Weber"),("name","Greg")]);Keys with no values get decoded to pairs with empty values.urlDecodeForm "is_test"!Right (fromList [("is_test","")])Empty keys are allowed:urlDecodeForm "=foobar" Right (fromList [("","foobar")]),The empty string gets decoded into an empty :urlDecodeForm ""Right (fromList [])Everything is un-escaped with unEscapeString:*urlDecodeForm "fullname=Andres%20L%C3%B6h"/Right (fromList [("fullname","Andres L\246h")])-Improperly formed strings result in an error:(urlDecodeForm "this=has=too=many=equals"1Left "not a valid pair: this=has=too=many=equals" http-api-data Decode an !application/x-www-form-urlencoded  to a list of key-value pairs. See also . http-api-data/This is a convenience function for decoding a !application/x-www-form-urlencoded 1 directly to a datatype that has an instance of .This is effectively   .:urlDecodeAsForm "name=Dennis&age=22" :: Either Text Person*Right (Person {name = "Dennis", age = 22}) http-api-dataThis is a convenience function for encoding a datatype that has instance of  directly to a !application/x-www-form-urlencoded .This is effectively  . ._NOTE:_ this encoding is unstable and may result in different key order (but not values). For a stable encoding see . http-api-dataThis is a convenience function for encoding a datatype that has instance of  directly to a !application/x-www-form-urlencoded .This is effectively  . .8urlEncodeAsFormStable Person {name = "Dennis", age = 22}"age=22&name=Dennis" http-api-data2Find all values corresponding to a given key in a .lookupAll "name" [][]#lookupAll "name" [("name", "Oleg")]["Oleg"]6lookupAll "name" [("name", "Oleg"), ("name", "David")]["Oleg","David"] http-api-dataLookup an optional value for a key. Fail if there is more than one value.lookupMaybe "name" [] Right Nothing%lookupMaybe "name" [("name", "Oleg")]Right (Just "Oleg")8lookupMaybe "name" [("name", "Oleg"), ("name", "David")]Left "Duplicate key \"name\"" http-api-dataLookup a unique value for a key. Fail if there is zero or more than one value.lookupUnique "name" []"Left "Could not find key \"name\""&lookupUnique "name" [("name", "Oleg")] Right "Oleg"9lookupUnique "name" [("name", "Oleg"), ("name", "David")]Left "Duplicate key \"name\"" http-api-data'Lookup all values for a given key in a  and parse them with .(parseAll "age" [] :: Either Text [Word8]Right []parseAll "age" [("age", "8"), ("age", "seven")] :: Either Text [Word8]Left "could not parse: `seven' (input does not start with a digit)"parseAll "age" [("age", "8"), ("age", "777")] :: Either Text [Word8]9Left "out of bounds: `777' (should be between 0 and 255)"parseAll "age" [("age", "12"), ("age", "25")] :: Either Text [Word8] Right [12,25] http-api-data;Lookup an optional value for a given key and parse it with 4. Fail if there is more than one value for the key.0parseMaybe "age" [] :: Either Text (Maybe Word8) Right NothingparseMaybe "age" [("age", "12"), ("age", "25")] :: Either Text (Maybe Word8)Left "Duplicate key \"age\""parseMaybe "age" [("age", "seven")] :: Either Text (Maybe Word8)Left "could not parse: `seven' (input does not start with a digit)">parseMaybe "age" [("age", "777")] :: Either Text (Maybe Word8)9Left "out of bounds: `777' (should be between 0 and 255)"?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(http-api-data-0.5-AbjXz67ybWfGU87gpfJgVDWeb.Internal.HttpApiDataWeb.Internal.FormUrlEncodedWeb.FormUrlEncodedWeb.HttpApiData LenientDatagetLenientDataFromHttpApiData parseUrlPiece parseHeaderparseQueryParam ToHttpApiData toUrlPiecetoEncodedUrlPiecetoHeader toQueryParam toUrlPiecesparseUrlPieces toQueryParamsparseQueryParamsparseUrlPieceMaybeparseHeaderMaybeparseQueryParamMaybedefaultParseErrorparseMaybeTextData showTextDatashowtparseUrlPieceWithPrefixparseHeaderWithPrefixparseQueryParamWithPrefixparseBoundedTextDatalookupBoundedEnumOfparseBoundedEnumOfparseBoundedEnumOfIparseBoundedUrlPieceparseBoundedQueryParamparseBoundedHeader readTextData runReader parseBoundedunsafeToEncodedUrlPiecetimeToUrlPiecerunAtto$fToHttpApiDataUUID$fToHttpApiDataIdentity$fToHttpApiDataConst$fToHttpApiDataTagged$fToHttpApiDataSetCookie$fToHttpApiDataEither$fToHttpApiDataMaybe$fToHttpApiDataLast$fToHttpApiDataFirst$fToHttpApiDataMax$fToHttpApiDataMin$fToHttpApiDataLast0$fToHttpApiDataFirst0$fToHttpApiDataProduct$fToHttpApiDataSum$fToHttpApiDataDual$fToHttpApiDataAny$fToHttpApiDataAll$fToHttpApiDataText$fToHttpApiDataText0$fToHttpApiData[]$fToHttpApiDataNominalDiffTime$fToHttpApiDataMonth$fToHttpApiDataQuarter$fToHttpApiDataQuarterOfYear$fToHttpApiDataDayOfWeek$fToHttpApiDataUTCTime$fToHttpApiDataZonedTime$fToHttpApiDataLocalTime$fToHttpApiDataTimeOfDay$fToHttpApiDataDay$fToHttpApiDataFixed$fToHttpApiDataWord64$fToHttpApiDataWord32$fToHttpApiDataWord16$fToHttpApiDataWord8$fToHttpApiDataWord$fToHttpApiDataInteger$fToHttpApiDataInt64$fToHttpApiDataInt32$fToHttpApiDataInt16$fToHttpApiDataInt8$fToHttpApiDataInt$fToHttpApiDataFloat$fToHttpApiDataDouble$fToHttpApiDataOrdering$fToHttpApiDataBool$fToHttpApiDataNatural$fToHttpApiDataVoid$fToHttpApiDataVersion$fToHttpApiDataChar$fToHttpApiData()$fFromHttpApiDataIdentity$fFromHttpApiDataConst$fFromHttpApiDataTagged$fFromHttpApiDataSetCookie$fFromHttpApiDataUUID$fFromHttpApiDataEither$fFromHttpApiDataMaybe$fFromHttpApiDataLast$fFromHttpApiDataFirst$fFromHttpApiDataMax$fFromHttpApiDataMin$fFromHttpApiDataLast0$fFromHttpApiDataFirst0$fFromHttpApiDataProduct$fFromHttpApiDataSum$fFromHttpApiDataDual$fFromHttpApiDataAny$fFromHttpApiDataAll$fFromHttpApiDataQuarterOfYear$fFromHttpApiDataQuarter$fFromHttpApiDataMonth $fFromHttpApiDataNominalDiffTime$fFromHttpApiDataDayOfWeek$fFromHttpApiDataUTCTime$fFromHttpApiDataZonedTime$fFromHttpApiDataLocalTime$fFromHttpApiDataTimeOfDay$fFromHttpApiDataDay$fFromHttpApiDataFixed$fFromHttpApiDataText$fFromHttpApiDataText0$fFromHttpApiData[]$fFromHttpApiDataWord64$fFromHttpApiDataWord32$fFromHttpApiDataWord16$fFromHttpApiDataWord8$fFromHttpApiDataWord$fFromHttpApiDataInteger$fFromHttpApiDataInt64$fFromHttpApiDataInt32$fFromHttpApiDataInt16$fFromHttpApiDataInt8$fFromHttpApiDataInt$fFromHttpApiDataFloat$fFromHttpApiDataDouble$fFromHttpApiDataOrdering$fFromHttpApiDataBool$fFromHttpApiDataNatural$fFromHttpApiDataVoid$fFromHttpApiDataVersion$fFromHttpApiDataChar$fFromHttpApiData()$fFromHttpApiDataLenientData$fEqLenientData$fOrdLenientData$fShowLenientData$fReadLenientData$fDataLenientData$fFunctorLenientData$fFoldableLenientData$fTraversableLenientData FormOptionsfieldLabelModifier GFromForm gFromFormFromFormfromFormGToFormgToForm NotSupportedProxy3ToFormtoFormFormunForm FromFormKey parseFormKey ToFormKey toFormKey toListStablefromEntriesByKey genericToFormtoEntriesByKeytoEntriesByKeyStablegenericFromForm urlEncodeFormurlEncodeFormStableurlEncodeParams urlDecodeFormurlDecodeParamsurlDecodeAsFormurlEncodeAsFormurlEncodeAsFormStable lookupAll lookupMaybe lookupUniqueparseAll parseMaybe parseUniquedefaultFormOptionssortOn$fToFormKeyNatural$fToFormKeyVoid$fToFormKeyConst$fToFormKeyIdentity$fToFormKeyTagged$fToFormKeyLast$fToFormKeyFirst$fToFormKeyMax$fToFormKeyMin$fToFormKeyProduct$fToFormKeySum$fToFormKeyDual$fToFormKeyAny$fToFormKeyAll$fToFormKeyText$fToFormKeyText0 $fToFormKey[]$fToFormKeyMonth$fToFormKeyQuarterOfYear$fToFormKeyQuarter$fToFormKeyNominalDiffTime$fToFormKeyUTCTime$fToFormKeyZonedTime$fToFormKeyLocalTime$fToFormKeyDay$fToFormKeyWord64$fToFormKeyWord32$fToFormKeyWord16$fToFormKeyWord8$fToFormKeyWord$fToFormKeyInteger$fToFormKeyInt64$fToFormKeyInt32$fToFormKeyInt16$fToFormKeyInt8$fToFormKeyInt$fToFormKeyFloat$fToFormKeyDouble$fToFormKeyOrdering$fToFormKeyBool$fToFormKeyChar $fToFormKey()$fFromFormKeyNatural$fFromFormKeyVoid$fFromFormKeyConst$fFromFormKeyIdentity$fFromFormKeyTagged$fFromFormKeyLast$fFromFormKeyFirst$fFromFormKeyMax$fFromFormKeyMin$fFromFormKeyProduct$fFromFormKeySum$fFromFormKeyDual$fFromFormKeyAny$fFromFormKeyAll$fFromFormKeyText$fFromFormKeyText0$fFromFormKey[]$fFromFormKeyMonth$fFromFormKeyQuarterOfYear$fFromFormKeyQuarter$fFromFormKeyNominalDiffTime$fFromFormKeyUTCTime$fFromFormKeyZonedTime$fFromFormKeyLocalTime$fFromFormKeyDay$fFromFormKeyWord64$fFromFormKeyWord32$fFromFormKeyWord16$fFromFormKeyWord8$fFromFormKeyWord$fFromFormKeyInteger$fFromFormKeyInt64$fFromFormKeyInt32$fFromFormKeyInt16$fFromFormKeyInt8$fFromFormKeyInt$fFromFormKeyFloat$fFromFormKeyDouble$fFromFormKeyOrdering$fFromFormKeyBool$fFromFormKeyChar$fFromFormKey() $fIsListForm $fShowForm$fGFromFormktM1$fGFromFormktM10$fGFromFormktM11$fGFromFormktM12$fGFromFormktM13$fGFromFormktM14$fGFromFormkt:*:$fGFromFormkt:+:$fFromFormIntMap$fFromFormHashMap $fFromFormMap $fFromForm[]$fFromFormForm $fGToFormktM1$fGToFormktM10$fGToFormktM11$fGToFormktM12$fGToFormktM13$fGToFormktM14$fGToFormkt:*:$fGToFormkt:+:$fToFormIntMap$fToFormHashMap $fToFormMap $fToForm[] $fToFormForm$fEqForm $fReadForm $fGenericForm$fSemigroupForm $fMonoidFormbase Data.EitherRight'http-types-0.12.3-XEQjpts9GnAkrn83W7LXBNetwork.HTTP.Types.URIencodePathSegmentsRelative GHC.MaybeMaybeEither text-1.2.3.2Data.Text.InternalTextGHC.ShowShowshowGHC.ReadReadData.Text.ReadReader Data.VoidVoid GHC.GenericsGenericGHC.BasemapGHC.Listdrop Data.Foldablelength Data.Functor<$><*>containers-0.6.2.1Data.Map.InternalMapGHC.ExtstoListJustNothingghc-prim GHC.TypesCharbytestring-0.10.10.0Data.ByteString.Lazy.Internal ByteString Control.Monad<=<