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


-- | Encode unicode strings to ascii forms according to RFC 3492
--   
--   Encode unicode strings to ascii forms according to RFC 3492. It is
--   written in pure Haskell, as opposed to gnuidn's
--   Data.Text.IDN.Punycode. Please note that Data.Encoding.BootString from
--   the <a>encoding</a> package also contains an implementation of the
--   Punycode algorithm.
@package punycode
@version 2.0

module Data.Text.Punycode

-- | Encode a string into its ascii form
encode :: Text -> ByteString
data PunycodeDecodeException
GenericDecodeException :: PunycodeDecodeException
InternalStringTooShort :: PunycodeDecodeException
InputTooShort :: PunycodeDecodeException
RightOfHyphenShouldBeAlphanumeric :: PunycodeDecodeException
LeftOfHyphenShouldBeBasic :: PunycodeDecodeException
CantStartWithDash :: PunycodeDecodeException
InvalidCodePoint :: PunycodeDecodeException

-- | Decode a string into its unicode form
decode :: ByteString -> Either PunycodeDecodeException Text
