Codec.Binary.Url

dataenc-0.14.0.5: Data encoding library

Safe Haskell | Safe-Inferred

Codec.Binary.Url

Description

URL encoding, sometimes referred to as URI encoding or percent encoding. Implemented based on RFC 3986 (http://tools.ietf.org/html/rfc3986).

Further documentation and information can be found at http://www.haskell.org/haskellwiki/Library/Data_encoding.

Synopsis

- data EncIncData
  - = EChunk [Word8]
  - | EDone
- data EncIncRes i
  - = EPart i (EncIncData -> EncIncRes i)
  - | EFinal i
- encodeInc :: EncIncData -> EncIncRes String
- encode :: [Word8] -> String
- data DecIncData i
- data DecIncRes i
- decodeInc :: DecIncData String -> DecIncRes String
- decode :: String -> Maybe [Word8]
- chop :: Int -> String -> [String]
- unchop :: [String] -> String

# Documentation

data EncIncData

Data type for the incremental encoding functions.

Constructors

EChunk [Word8] | a chunk of data to be encoded
EDone | the signal to the encoder that the stream of data is ending

data EncIncRes i

Data type for the result of calling the incremental encoding functions.

Constructors

EPart i (EncIncData -> EncIncRes i) | a partial result together with the continuation to use for further encoding
EFinal i | the final result of encoding (the response to `EDone`)

encodeInc :: EncIncData -> EncIncRes String

Incremental decoder function.

encode :: [Word8] -> String

Encode data.

data DecIncData i

Data type for the incremental decoding functions.

data DecIncRes i

Data type for the result of calling the incremental encoding functions.

decodeInc :: DecIncData String -> DecIncRes String

Incremental decoder function.

decode :: String -> Maybe [Word8]

Decode data.

chop

Arguments

:: Int | length of individual lines
-> String |
-> [String] |

Chop up a string in parts.

unchop :: [String] -> String

Concatenate the strings into one long string