Encode is:module

Please read the Dhall.Tutorial module, which contains a tutorial explaining how to use the language, the compiler, and this library
Unicode aware URI encoding and decoding functions for both String and Text. Although standards are pretty vague about Unicode in URIs most browsers are pretty straightforward when encoding URIs: Encode a text to a UTF-8 string and URI-encode every individual byte (not character).
DNS message encoder. Note: DNS is a client library, and its focus is on sending queries, and receiving replies. Thefore, while this module is reasonably adept at query generation, building a DNS server with this module requires additional work to handle message size limits, correct UDP truncation, proper EDNS negotiation, and so on. Support for server-side DNS is at best rudimentary. For sending queries, in most cases you should be using one of the functions from Lookup and LookupRaw, or lastly, if you want to handle the network reads and writes for yourself (with your own code for UDP retries, TCP fallback, EDNS fallback, ...), then perhaps encodeQuestion (letting DNS do the lookups for you in an async thread is likely much simpler).
Most users of this library do not need this module. The functions here are used to build functions that apply a Colonnade to a collection of values, building a table from them. Ultimately, a function that applies a Colonnade Headed MyCell a to data will have roughly the following type:
myTableRenderer :: Foldable g => Colonnade Headed MyCell a -> g a -> MyContent
In the companion packages yesod-colonnade and reflex-dom-colonnade, functions with similar type signatures are readily available. These packages use the functions provided here in the implementations of their rendering functions. It is recommended that users who believe they may need this module look at the source of the companion packages to see an example of how this module's functions are used. Other backends are encouraged to use these functions to build monadic or monoidal content from a Colonnade. The functions exported here take a Colonnade and convert it to a fragment of content. The functions whose names start with row take at least a Colonnade f c a and an a value to generate a row of content. The functions whose names start with header need the Colonnade f c a but not an a value since a value is not needed to build a header.
Functions in this module serve as an alternative ToJSON type class. This allows to define for mapping from data type into multiple JSON representations. type level wrapping. There are two way of defining such encoder:
  • Using simple function a -> Value which doesn't require this library
  • Using this library as DSL together with Contravariant
A DSL for declaration of statement parameter encoders. For compactness of names all the types defined here imply being an encoder. E.g., the Array type is an encoder of arrays, not the data-structure itself.
Encoder and encoding primitives
This module defines a minifier and a printer for the GraphQL language.
Convert Haskell values to and from application/xxx-form-urlencoded format.
Provides a BEncode data type is well as functions for converting this data type to and from a String. Also supplies a number of properties which the module must satisfy.
This module provides convinient and fast way to serialize, deserealize and construct/destructure Bencoded values with optional fields. It supports four different types of values:
  • byte strings — represented as ByteString;
  • integers — represented as Integer;
  • lists - represented as ordinary lists;
  • dictionaries — represented as BDictMap;
To serialize any other types we need to make conversion. To make conversion more convenient there is type class for it: BEncode. Any textual strings are considered as UTF8 encoded Text. The complete Augmented BNF syntax for bencoding format is:
<BE>    ::= <DICT> | <LIST> | <INT> | <STR>

<DICT>  ::= "d" 1 * (<STR> <BE>) "e"
<LIST>  ::= "l" 1 * <BE>         "e"
<INT>   ::= "i"     <SNUM>       "e"
<STR>   ::= <NUM> ":" n * <CHAR>; where n equals the <NUM>

<SNUM>  ::= "-" <NUM> / <NUM>
<NUM>   ::= 1 * <DIGIT>
<CHAR>  ::= %
<DIGIT> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
This module is considered to be imported qualified, for example:
import Data.BEncode as BE
The module contains a Haskell interface to FLAC stream encoder.

How to use this module

Just call the encodeFlac function with EncoderSettings, input and output file names. The encodeFlac function only encodes vanilla WAVE and RF64.

Low-level details

The implementation uses the reference implementation of FLAC—libFLAC (C library) under the hood. This means you'll need at least version 1.3.0 of libFLAC (released 26 May 2013) installed for the binding to work. The binding works with minimal overhead compared to the C implementation. Encoding speed is equal to that of flac command line tool. Memory consumption is minimal and remains constant regardless of size of file to decode.
Provides a way to encode the needed constraint with possibly less symbols. Uses arrays instead of vectors.