encode -package:ip

Efficiently serialize a JSON value as a lazy ByteString. This is implemented in terms of the ToJSON class's toEncoding method.
Encode a value using binary serialisation to a lazy ByteString.
Encode a Haskell String to a list of Word8 values, in UTF8 format.
Encode a value using binary serialization to a strict ByteString.
Encode a string into base64 form. The result will always be a multiple of 4 bytes in length.
Encode a string into base64url form. The result will always be a multiple of 4 bytes in length.
Encode a value into its YAML representation.
Convert text into bytes, using the provided codec. If the codec is not capable of representing an input character, an exception will be thrown. Since 0.3.0
Encode a ByteString value in base16 (i.e. hexadecimal). Encoded values will always have a length that is a multiple of 2.

Examples:

encode "foo"  == "666f6f"
Efficiently serialize CSV records as a lazy ByteString.
Efficiently serialize records in an incremental fashion. Equivalent to encodeWith defaultEncodeOptions.
Convert a FilePath to a platform‐specific format, suitable for use with external OS functions. Note: The type platformTextFormat can change depending upon the underlying compilation platform. Consider using toText or encodeString instead. See Rules for more information. Since: 0.3
Convert a FilePath to a platform‐specific format, suitable for use with external OS functions. Note: The type of platformTextFormat can change depending upon the underlying compilation platform. Consider using toText or encodeString instead. See Rules for more information. Since: 0.3
Encode a Haskell value into a string, in JSON format. This is a superset of JSON, as types other than Array and Object are allowed at the top level.
Definition for encoding a given type into a binary representation, using the Encoding Monoid.
Definition for encoding a given type into a binary representation, using the Encoding Monoid.
URI encode a String, unicode aware.
Serializes a value to a ByteString. In order to do this, it first allocates a ByteString of the correct size (based on size), and then uses poke to fill it. Safety of this function depends on correctness of the Store instance. If size returns a. The good news is that this isn't an issue if you use well-tested manual instances (such as those from this package) combined with auomatic definition of instances.
Convert data type to the textual representation of TOML values.
Serialize YAML Node(s) using the YAML 1.2 Core schema to a lazy UTF8 encoded ByteString. Each YAML Node produces exactly one YAML Document. Here is an example of encoding a list of strings to produce a list of YAML Documents
>>> encode (["Document 1", "Document 2"] :: [Text])
"Document 1\n...\nDocument 2\n"
If we treat the above list of strings as a single sequence then we will produce a single YAML Document having a single sequence.
>>> encode ([["Document 1", "Document 2"]] :: [[Text]])
"- Document 1\n- Document 2\n"
Alternatively, if you only need a single YAML document in a YAML stream you might want to use the convenience function encode1; or, if you need more control over the encoding, see encodeNode'.
Encode a DNSMessage for transmission over UDP. For transmission over TCP encapsulate the result via encodeVC, or use sendVC, which handles this internally. If any ResourceRecord in the message contains incorrectly encoded Domain name ByteStrings, this function may raise a DecodeError.
Use the supplied JWKs to create a JWT. The list of keys will be searched to locate one which is consistent with the chosen encoding algorithms.