Hoogle Search
Within LTS Haskell 24.38 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
urlDecodeForm :: ByteString -> Either Text Formhttp-api-data Web.Internal.FormUrlEncoded Decode an application/x-www-form-urlencoded ByteString to a Form. Key-value pairs get decoded normally:
>>> urlDecodeForm "name=Greg&lastname=Weber" Right (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 Form:>>> 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" Left "not a valid pair: this=has=too=many=equals"
urlEncodeAsForm :: ToForm a => a -> ByteStringhttp-api-data Web.Internal.FormUrlEncoded This is a convenience function for encoding a datatype that has instance of ToForm directly to a application/x-www-form-urlencoded ByteString. This is effectively urlEncodeForm . toForm. _NOTE:_ this encoding is unstable and may result in different key order (but not values). For a stable encoding see urlEncodeAsFormStable.
urlEncodeAsFormStable :: ToForm a => a -> ByteStringhttp-api-data Web.Internal.FormUrlEncoded This is a convenience function for encoding a datatype that has instance of ToForm directly to a application/x-www-form-urlencoded ByteString. This is effectively urlEncodeFormStable . toForm.
>>> urlEncodeAsFormStable Person {name = "Dennis", age = 22} "age=22&name=Dennis"urlEncodeForm :: Form -> ByteStringhttp-api-data Web.Internal.FormUrlEncoded Encode a Form to an application/x-www-form-urlencoded ByteString. _NOTE:_ this encoding is unstable and may result in different key order (but not values). For a stable encoding see urlEncodeFormStable.
urlEncodeFormStable :: Form -> ByteStringhttp-api-data Web.Internal.FormUrlEncoded Encode a Form to an application/x-www-form-urlencoded ByteString. For an unstable (but faster) encoding see urlEncodeForm. 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 urlDecodeForm . urlEncodeFormStable from being a true isomorphism).>>> urlEncodeFormStable [("", "")] ""Everything is escaped with escapeURIString isUnreserved:>>> urlEncodeFormStable [("fullname", "Andres Löh")] "fullname=Andres%20L%C3%B6h"iso8601DateFormat :: Maybe String -> Stringold-locale System.Locale Construct format string according to ISO-8601. The Maybe String argument allows to supply an optional time specification. E.g.:
iso8601DateFormat Nothing == "%Y-%m-%d" -- i.e. YYYY-MM-DD iso8601DateFormat (Just "%H:%M:%S") == "%Y-%m-%dT%H:%M:%S" -- i.e. YYYY-MM-DDTHH:MM:SS
-
old-locale System.Locale Format string according to RFC822.
-
aeson-pretty Data.Aeson.Encode.Pretty No documentation available.
confNumFormat :: Config -> NumberFormataeson-pretty Data.Aeson.Encode.Pretty No documentation available.
-
mwc-random System.Random.MWC The class of types for which a uniformly distributed value can be drawn from all possible values of the type.