burrito-1.0.2.0: Parse and render URI templates.

Safe HaskellSafe
LanguageHaskell98

Burrito.Type.VarChar

Description

Warning: This module is not considered part of Burrito's public API. As such, it may change at any time. Use it with caution!.

Synopsis

Documentation

data VarChar Source #

Represents a single logical character in a variable name.

Constructors

Encoded Char Char

A percent encoded triple. Note that this represents three literal characters in the input, even though logically we always treat it as one character. The two arguments are the high and the low hexadecimal digits, respectively. This representation intentially keeps track of their case, so as to avoid confusing values like %aa and %AA. You should use makeEncoded to build these values.

Unencoded Char

A literal unencoded character. You should use makeUnencoded to build these values.

Instances
Eq VarChar Source # 
Instance details

Defined in Burrito.Type.VarChar

Methods

(==) :: VarChar -> VarChar -> Bool #

(/=) :: VarChar -> VarChar -> Bool #

Show VarChar Source # 
Instance details

Defined in Burrito.Type.VarChar

Lift VarChar Source # 
Instance details

Defined in Burrito.Type.VarChar

Methods

lift :: VarChar -> Q Exp #

makeEncoded :: Char -> Char -> Maybe VarChar Source #

Makes sure that both characters are valid hexadecimal digits. If they are, returns an Encoded character. Otherwise returns nothing.

makeUnencoded :: Char -> Maybe VarChar Source #

Makes sure that the character passes the isVarchar predicate. If it does, returns an Unencoded character. Otherwise returns nothing.

isVarchar :: Char -> Bool Source #

Returns true if the given character is in the varchar range defined by section 2.3 of the RFC. Note that this does not include the pct-encoded part of the grammar because that requires multiple characters to match.