-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Bindings for GNU IDN
--   
--   Bindings for GNU IDN
@package gnuidn
@version 0.2


-- | Punycode is a simple and efficient transfer encoding syntax designed
--   for use with Internationalized Domain Names in Applications (IDNA). It
--   uniquely and reversibly transforms a Unicode string into ASCII. ASCII
--   characters in the Unicode string are represented literally, and
--   non-ASCII characters are represented by ASCII characters that are
--   allowed in host name labels (letters, digits, and hyphens).
module Data.Text.IDN.Punycode

-- | Encode unicode into an ASCII-only <a>ByteString</a>. If provided, the
--   case predicate indicates whether to uppercase the corresponding
--   character after decoding.
encode :: Text -> Maybe (Integer -> Bool) -> ByteString

-- | Decode a <a>ByteString</a> into unicode. The second component of the
--   result is a case predicate; it indicates whether a particular
--   character position of the result string should be upper-cased.
--   
--   Returns <a>Nothing</a> if the input is invalid.
decode :: ByteString -> Maybe (Text, Integer -> Bool)
instance Enum Punycode_status

module Data.Text.IDN.StringPrep
data Flags
Flags :: Bool -> Bool -> Bool -> Flags

-- | Enable the NFKC normalization, as well as selecting the NFKC case
--   folding tables. Usually the profile specifies BIDI and NFKC settings,
--   and applications should not override it unless in special situations.
enableNFKC :: Flags -> Bool

-- | Enable the BIDI step. Usually the profile specifies BIDI and NFKC
--   settings, and applications should not override it unless in special
--   situations.
enableBidi :: Flags -> Bool

-- | If false, <a>stringprep</a> will return an error if the input contains
--   characters not assigned to the profile.
allowUnassigned :: Flags -> Bool
data Error

-- | <pre>
--   defaultFlags = Flags True True False
--   </pre>
defaultFlags :: Flags
stringprep :: Profile -> Flags -> Text -> Either Error Text
data Profile

-- | iSCSI (RFC 3722)
iscsi :: Profile

-- | Kerberos 5
kerberos5 :: Profile

-- | Nameprep (RFC 3491)
nameprep :: Profile

-- | SASLprep (RFC 4013)
sasl :: Profile

-- | Draft SASL ANONYMOUS
saslAnonymous :: Profile
trace :: Profile

-- | XMPP node (RFC 3920)
xmppNode :: Profile

-- | XMPP resource (RFC 3920)
xmppResource :: Profile
instance Show Flags
instance Eq Flags
instance Enum Stringprep_profile_flags
instance Enum Stringprep_rc

module Data.Text.IDN.IDNA
data Flags
Flags :: Bool -> Bool -> Flags

-- | Check output to make sure it is a STD3-conforming host name
verifySTD3 :: Flags -> Bool

-- | Allow unassigned Unicode code points
allowUnassigned :: Flags -> Bool
data Error

-- | <pre>
--   defaultFlags = Flags True False
--   </pre>
defaultFlags :: Flags

-- | Convert a Unicode domain name to an ASCII <a>ByteString</a>. The
--   domain name may contain several labels, separated by periods.
--   
--   <tt>toASCII</tt> never alters a sequence of code points that are all
--   in the ASCII range to begin with (although it could fail). Applying
--   <tt>toASCII</tt> multiple times gives the same result as applying it
--   once.
toASCII :: Flags -> Text -> Either Error ByteString

-- | Convert a possibly ACE-encoded domain name to Unicode. The domain name
--   may contain several labels, separated by dots.
--   
--   Aside from memory allocation failure, <tt>toUnicode</tt> always
--   succeeds. If the input cannot be decoded, it is returned unchanged.
toUnicode :: Flags -> ByteString -> Text
instance Show Flags
instance Eq Flags
instance Enum Idna_flags
instance Enum Idna_rc
