    {-# LANGUAGE TypeSynonymInstances #-}
    module Text.XML.HaXml.Schema.PrimitiveTypes
      ( -- * Type class for parsing simpleTypes
        SimpleType(..)
      , module Text.Parse
      , -- * Primitive XSD datatypes
        XsdString(..)
      , Boolean(..)
      , Base64Binary(..)
      , HexBinary(..)
      , Float(..)
      , Decimal(..)
      , Double(..)
      , AnyURI(..)
      , QName(..)
      , NOTATION(..)
      , Duration(..)
      , DateTime(..)
      , Time(..)
      , Date(..)
      , GYearMonth(..)
      , GYear(..)
      , GMonthDay(..)
      , GDay(..)
      , GMonth(..)
      , -- * Derived, yet builtin, datatypes
        NormalizedString(..)
      , Token(..)
      , Language(..)
      , Name(..)
      , NCName(..)
      , ID(..)
      , IDREF(..)
      , IDREFS(..)
      , ENTITY(..)
      , ENTITIES(..)
      , NMTOKEN(..)
      , NMTOKENS(..)
      , Integer(..)
      , NonPositiveInteger(..)
      , NegativeInteger(..)
      , Long(..)
      , Int(..)
      , Short(..)
      , Byte(..)
      , NonNegativeInteger(..)
      , UnsignedLong(..)
      , UnsignedInt(..)
      , UnsignedShort(..)
      , UnsignedByte(..)
      , PositiveInteger(..)
      ) where

    import Text.Parse
    import Data.Char as Char
    --import Data.Time.LocalTime -- for dates and times?
    import Text.XML.HaXml.Types (QName(..))
    import Data.Int
    import Data.Word

    -- | Ultimately, an XML parser will find some plain text as the content
    --   of a simpleType, which will need to be parsed.  We use a TextParser,
    --   because values of simpleTypes can also be given elsewhere, e.g. as
    --   attribute values in an XSD definition, e.g. to restrict the permissible
    --   values of the simpleType.  Such restrictions are therefore implemented
    --   as layered parsers.
    class SimpleType a where
      acceptingParser :: TextParser a
      simpleTypeText  :: a -> String

    -- * Primitive types

    type Boolean      = Bool
    newtype XsdString = XsdString    String    deriving (XsdString -> XsdString -> Bool
    (XsdString -> XsdString -> Bool)
    -> (XsdString -> XsdString -> Bool) -> Eq XsdString
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: XsdString -> XsdString -> Bool
    == :: XsdString -> XsdString -> Bool
    $c/= :: XsdString -> XsdString -> Bool
    /= :: XsdString -> XsdString -> Bool
    Eq,Int -> XsdString -> ShowS
    [XsdString] -> ShowS
    XsdString -> String
    (Int -> XsdString -> ShowS)
    -> (XsdString -> String)
    -> ([XsdString] -> ShowS)
    -> Show XsdString
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> XsdString -> ShowS
    showsPrec :: Int -> XsdString -> ShowS
    $cshow :: XsdString -> String
    show :: XsdString -> String
    $cshowList :: [XsdString] -> ShowS
    showList :: [XsdString] -> ShowS
    Show)
    data Base64Binary = Base64Binary String    deriving (Base64Binary -> Base64Binary -> Bool
    (Base64Binary -> Base64Binary -> Bool)
    -> (Base64Binary -> Base64Binary -> Bool) -> Eq Base64Binary
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Base64Binary -> Base64Binary -> Bool
    == :: Base64Binary -> Base64Binary -> Bool
    $c/= :: Base64Binary -> Base64Binary -> Bool
    /= :: Base64Binary -> Base64Binary -> Bool
    Eq,Int -> Base64Binary -> ShowS
    [Base64Binary] -> ShowS
    Base64Binary -> String
    (Int -> Base64Binary -> ShowS)
    -> (Base64Binary -> String)
    -> ([Base64Binary] -> ShowS)
    -> Show Base64Binary
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Base64Binary -> ShowS
    showsPrec :: Int -> Base64Binary -> ShowS
    $cshow :: Base64Binary -> String
    show :: Base64Binary -> String
    $cshowList :: [Base64Binary] -> ShowS
    showList :: [Base64Binary] -> ShowS
    Show)
    data HexBinary    = HexBinary    String    deriving (HexBinary -> HexBinary -> Bool
    (HexBinary -> HexBinary -> Bool)
    -> (HexBinary -> HexBinary -> Bool) -> Eq HexBinary
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: HexBinary -> HexBinary -> Bool
    == :: HexBinary -> HexBinary -> Bool
    $c/= :: HexBinary -> HexBinary -> Bool
    /= :: HexBinary -> HexBinary -> Bool
    Eq,Int -> HexBinary -> ShowS
    [HexBinary] -> ShowS
    HexBinary -> String
    (Int -> HexBinary -> ShowS)
    -> (HexBinary -> String)
    -> ([HexBinary] -> ShowS)
    -> Show HexBinary
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> HexBinary -> ShowS
    showsPrec :: Int -> HexBinary -> ShowS
    $cshow :: HexBinary -> String
    show :: HexBinary -> String
    $cshowList :: [HexBinary] -> ShowS
    showList :: [HexBinary] -> ShowS
    Show)
    data AnyURI       = AnyURI       String    deriving (AnyURI -> AnyURI -> Bool
    (AnyURI -> AnyURI -> Bool)
    -> (AnyURI -> AnyURI -> Bool) -> Eq AnyURI
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: AnyURI -> AnyURI -> Bool
    == :: AnyURI -> AnyURI -> Bool
    $c/= :: AnyURI -> AnyURI -> Bool
    /= :: AnyURI -> AnyURI -> Bool
    Eq,Int -> AnyURI -> ShowS
    [AnyURI] -> ShowS
    AnyURI -> String
    (Int -> AnyURI -> ShowS)
    -> (AnyURI -> String) -> ([AnyURI] -> ShowS) -> Show AnyURI
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> AnyURI -> ShowS
    showsPrec :: Int -> AnyURI -> ShowS
    $cshow :: AnyURI -> String
    show :: AnyURI -> String
    $cshowList :: [AnyURI] -> ShowS
    showList :: [AnyURI] -> ShowS
    Show)
    --data QName
    data NOTATION     = NOTATION String -- or re-use NOTATION from HaXml.Types?
                                               deriving (NOTATION -> NOTATION -> Bool
    (NOTATION -> NOTATION -> Bool)
    -> (NOTATION -> NOTATION -> Bool) -> Eq NOTATION
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: NOTATION -> NOTATION -> Bool
    == :: NOTATION -> NOTATION -> Bool
    $c/= :: NOTATION -> NOTATION -> Bool
    /= :: NOTATION -> NOTATION -> Bool
    Eq,Int -> NOTATION -> ShowS
    [NOTATION] -> ShowS
    NOTATION -> String
    (Int -> NOTATION -> ShowS)
    -> (NOTATION -> String) -> ([NOTATION] -> ShowS) -> Show NOTATION
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> NOTATION -> ShowS
    showsPrec :: Int -> NOTATION -> ShowS
    $cshow :: NOTATION -> String
    show :: NOTATION -> String
    $cshowList :: [NOTATION] -> ShowS
    showList :: [NOTATION] -> ShowS
    Show)
    data Decimal      = Decimal Double         deriving (Decimal -> Decimal -> Bool
    (Decimal -> Decimal -> Bool)
    -> (Decimal -> Decimal -> Bool) -> Eq Decimal
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Decimal -> Decimal -> Bool
    == :: Decimal -> Decimal -> Bool
    $c/= :: Decimal -> Decimal -> Bool
    /= :: Decimal -> Decimal -> Bool
    Eq,Int -> Decimal -> ShowS
    [Decimal] -> ShowS
    Decimal -> String
    (Int -> Decimal -> ShowS)
    -> (Decimal -> String) -> ([Decimal] -> ShowS) -> Show Decimal
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Decimal -> ShowS
    showsPrec :: Int -> Decimal -> ShowS
    $cshow :: Decimal -> String
    show :: Decimal -> String
    $cshowList :: [Decimal] -> ShowS
    showList :: [Decimal] -> ShowS
    Show)
    --data Float
    --data Double
    data Duration     = Duration Bool Int Int Int Int Int Float  deriving (Duration -> Duration -> Bool
    (Duration -> Duration -> Bool)
    -> (Duration -> Duration -> Bool) -> Eq Duration
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Duration -> Duration -> Bool
    == :: Duration -> Duration -> Bool
    $c/= :: Duration -> Duration -> Bool
    /= :: Duration -> Duration -> Bool
    Eq,Int -> Duration -> ShowS
    [Duration] -> ShowS
    Duration -> String
    (Int -> Duration -> ShowS)
    -> (Duration -> String) -> ([Duration] -> ShowS) -> Show Duration
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Duration -> ShowS
    showsPrec :: Int -> Duration -> ShowS
    $cshow :: Duration -> String
    show :: Duration -> String
    $cshowList :: [Duration] -> ShowS
    showList :: [Duration] -> ShowS
    Show)

    -- * All of the following temporal types are incompletely specified for now.
    --   They should probably be mapped to something appropriate from the time
    --   package?

    data DateTime     = DateTime String        deriving (DateTime -> DateTime -> Bool
    (DateTime -> DateTime -> Bool)
    -> (DateTime -> DateTime -> Bool) -> Eq DateTime
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: DateTime -> DateTime -> Bool
    == :: DateTime -> DateTime -> Bool
    $c/= :: DateTime -> DateTime -> Bool
    /= :: DateTime -> DateTime -> Bool
    Eq,Int -> DateTime -> ShowS
    [DateTime] -> ShowS
    DateTime -> String
    (Int -> DateTime -> ShowS)
    -> (DateTime -> String) -> ([DateTime] -> ShowS) -> Show DateTime
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> DateTime -> ShowS
    showsPrec :: Int -> DateTime -> ShowS
    $cshow :: DateTime -> String
    show :: DateTime -> String
    $cshowList :: [DateTime] -> ShowS
    showList :: [DateTime] -> ShowS
    Show) -- LocalTime ?
    data Time         = Time String            deriving (Time -> Time -> Bool
    (Time -> Time -> Bool) -> (Time -> Time -> Bool) -> Eq Time
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Time -> Time -> Bool
    == :: Time -> Time -> Bool
    $c/= :: Time -> Time -> Bool
    /= :: Time -> Time -> Bool
    Eq,Int -> Time -> ShowS
    [Time] -> ShowS
    Time -> String
    (Int -> Time -> ShowS)
    -> (Time -> String) -> ([Time] -> ShowS) -> Show Time
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Time -> ShowS
    showsPrec :: Int -> Time -> ShowS
    $cshow :: Time -> String
    show :: Time -> String
    $cshowList :: [Time] -> ShowS
    showList :: [Time] -> ShowS
    Show) -- TimeOfDay ?
    data Date         = Date String            deriving (Date -> Date -> Bool
    (Date -> Date -> Bool) -> (Date -> Date -> Bool) -> Eq Date
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Date -> Date -> Bool
    == :: Date -> Date -> Bool
    $c/= :: Date -> Date -> Bool
    /= :: Date -> Date -> Bool
    Eq,Int -> Date -> ShowS
    [Date] -> ShowS
    Date -> String
    (Int -> Date -> ShowS)
    -> (Date -> String) -> ([Date] -> ShowS) -> Show Date
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Date -> ShowS
    showsPrec :: Int -> Date -> ShowS
    $cshow :: Date -> String
    show :: Date -> String
    $cshowList :: [Date] -> ShowS
    showList :: [Date] -> ShowS
    Show) -- Day ?
    data GYearMonth   = GYearMonth String      deriving (GYearMonth -> GYearMonth -> Bool
    (GYearMonth -> GYearMonth -> Bool)
    -> (GYearMonth -> GYearMonth -> Bool) -> Eq GYearMonth
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: GYearMonth -> GYearMonth -> Bool
    == :: GYearMonth -> GYearMonth -> Bool
    $c/= :: GYearMonth -> GYearMonth -> Bool
    /= :: GYearMonth -> GYearMonth -> Bool
    Eq,Int -> GYearMonth -> ShowS
    [GYearMonth] -> ShowS
    GYearMonth -> String
    (Int -> GYearMonth -> ShowS)
    -> (GYearMonth -> String)
    -> ([GYearMonth] -> ShowS)
    -> Show GYearMonth
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> GYearMonth -> ShowS
    showsPrec :: Int -> GYearMonth -> ShowS
    $cshow :: GYearMonth -> String
    show :: GYearMonth -> String
    $cshowList :: [GYearMonth] -> ShowS
    showList :: [GYearMonth] -> ShowS
    Show) -- ??
    data GYear        = GYear String           deriving (GYear -> GYear -> Bool
    (GYear -> GYear -> Bool) -> (GYear -> GYear -> Bool) -> Eq GYear
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: GYear -> GYear -> Bool
    == :: GYear -> GYear -> Bool
    $c/= :: GYear -> GYear -> Bool
    /= :: GYear -> GYear -> Bool
    Eq,Int -> GYear -> ShowS
    [GYear] -> ShowS
    GYear -> String
    (Int -> GYear -> ShowS)
    -> (GYear -> String) -> ([GYear] -> ShowS) -> Show GYear
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> GYear -> ShowS
    showsPrec :: Int -> GYear -> ShowS
    $cshow :: GYear -> String
    show :: GYear -> String
    $cshowList :: [GYear] -> ShowS
    showList :: [GYear] -> ShowS
    Show) -- ??
    data GMonthDay    = GMonthDay String       deriving (GMonthDay -> GMonthDay -> Bool
    (GMonthDay -> GMonthDay -> Bool)
    -> (GMonthDay -> GMonthDay -> Bool) -> Eq GMonthDay
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: GMonthDay -> GMonthDay -> Bool
    == :: GMonthDay -> GMonthDay -> Bool
    $c/= :: GMonthDay -> GMonthDay -> Bool
    /= :: GMonthDay -> GMonthDay -> Bool
    Eq,Int -> GMonthDay -> ShowS
    [GMonthDay] -> ShowS
    GMonthDay -> String
    (Int -> GMonthDay -> ShowS)
    -> (GMonthDay -> String)
    -> ([GMonthDay] -> ShowS)
    -> Show GMonthDay
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> GMonthDay -> ShowS
    showsPrec :: Int -> GMonthDay -> ShowS
    $cshow :: GMonthDay -> String
    show :: GMonthDay -> String
    $cshowList :: [GMonthDay] -> ShowS
    showList :: [GMonthDay] -> ShowS
    Show) -- ??
    data GDay         = GDay String            deriving (GDay -> GDay -> Bool
    (GDay -> GDay -> Bool) -> (GDay -> GDay -> Bool) -> Eq GDay
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: GDay -> GDay -> Bool
    == :: GDay -> GDay -> Bool
    $c/= :: GDay -> GDay -> Bool
    /= :: GDay -> GDay -> Bool
    Eq,Int -> GDay -> ShowS
    [GDay] -> ShowS
    GDay -> String
    (Int -> GDay -> ShowS)
    -> (GDay -> String) -> ([GDay] -> ShowS) -> Show GDay
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> GDay -> ShowS
    showsPrec :: Int -> GDay -> ShowS
    $cshow :: GDay -> String
    show :: GDay -> String
    $cshowList :: [GDay] -> ShowS
    showList :: [GDay] -> ShowS
    Show) -- ??
    data GMonth       = GMonth String          deriving (GMonth -> GMonth -> Bool
    (GMonth -> GMonth -> Bool)
    -> (GMonth -> GMonth -> Bool) -> Eq GMonth
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: GMonth -> GMonth -> Bool
    == :: GMonth -> GMonth -> Bool
    $c/= :: GMonth -> GMonth -> Bool
    /= :: GMonth -> GMonth -> Bool
    Eq,Int -> GMonth -> ShowS
    [GMonth] -> ShowS
    GMonth -> String
    (Int -> GMonth -> ShowS)
    -> (GMonth -> String) -> ([GMonth] -> ShowS) -> Show GMonth
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> GMonth -> ShowS
    showsPrec :: Int -> GMonth -> ShowS
    $cshow :: GMonth -> String
    show :: GMonth -> String
    $cshowList :: [GMonth] -> ShowS
    showList :: [GMonth] -> ShowS
    Show) -- ??

    isNext :: Char -> TextParser Char
    isNext :: Char -> TextParser Char
    isNext Char
    c = do d <- TextParser Char
    forall t. Parser t t
    next
                  if c==d then return c else fail ("expected "++c:", got "++d:".")

    instance SimpleType Bool where
        acceptingParser :: TextParser Bool
    acceptingParser = do w <- TextParser String
    word
                             case w of String
    "true"  -> Bool -> TextParser Bool
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Bool
    True;
                                       String
    "false" -> Bool -> TextParser Bool
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Bool
    False
                                       String
    "0"     -> Bool -> TextParser Bool
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Bool
    False;
                                       String
    "1"     -> Bool -> TextParser Bool
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Bool
    True
                                       String
    _       -> String -> TextParser Bool
    forall a. String -> Parser Char a
    forall (m :: * -> *) a. MonadFail m => String -> m a
    fail (String
    "Not a bool: "String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++String
    w)
        simpleTypeText :: Bool -> String
    simpleTypeText Bool
    False = String
    "false"
        simpleTypeText Bool
    True  = String
    "true"
    instance SimpleType XsdString where
        acceptingParser :: TextParser XsdString
    acceptingParser = (String -> XsdString) -> TextParser String -> TextParser XsdString
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> XsdString
    XsdString (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
        simpleTypeText :: XsdString -> String
    simpleTypeText (XsdString String
    s) = String
    s
    instance SimpleType Base64Binary where
        acceptingParser :: TextParser Base64Binary
    acceptingParser = (String -> Base64Binary)
    -> TextParser String -> TextParser Base64Binary
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> Base64Binary
    Base64Binary (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many ((Char -> Bool) -> TextParser Char
    forall t. (t -> Bool) -> Parser t t
    satisfy Char -> Bool
    isAlphaNum TextParser Char -> TextParser Char -> TextParser Char
    forall t a. Parser t a -> Parser t a -> Parser t a
    `onFail`
                                                   (Char -> Bool) -> TextParser Char
    forall t. (t -> Bool) -> Parser t t
    satisfy Char -> Bool
    isSpace TextParser Char -> TextParser Char -> TextParser Char
    forall t a. Parser t a -> Parser t a -> Parser t a
    `onFail`
                                                   (Char -> Bool) -> TextParser Char
    forall t. (t -> Bool) -> Parser t t
    satisfy (Char -> String -> Bool
    forall a. Eq a => a -> [a] -> Bool
    forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
    `elem`String
    "+/=")))
        simpleTypeText :: Base64Binary -> String
    simpleTypeText (Base64Binary String
    s) = String
    s
    instance SimpleType HexBinary where
        acceptingParser :: TextParser HexBinary
    acceptingParser = (String -> HexBinary) -> TextParser String -> TextParser HexBinary
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> HexBinary
    HexBinary (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many ((Char -> Bool) -> TextParser Char
    forall t. (t -> Bool) -> Parser t t
    satisfy Char -> Bool
    Char.isHexDigit))
        simpleTypeText :: HexBinary -> String
    simpleTypeText (HexBinary String
    s) = String
    s
    instance SimpleType AnyURI where
        acceptingParser :: TextParser AnyURI
    acceptingParser = (String -> AnyURI) -> TextParser String -> TextParser AnyURI
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> AnyURI
    AnyURI (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next) -- not very satisfactory
        simpleTypeText :: AnyURI -> String
    simpleTypeText (AnyURI String
    s) = String
    s
    instance SimpleType NOTATION where
        acceptingParser :: TextParser NOTATION
    acceptingParser = (String -> NOTATION) -> TextParser String -> TextParser NOTATION
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> NOTATION
    NOTATION (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next) -- not very satisfactory
        simpleTypeText :: NOTATION -> String
    simpleTypeText (NOTATION String
    s) = String
    s

    instance SimpleType Decimal where
        acceptingParser :: TextParser Decimal
    acceptingParser = (Double -> Decimal) -> Parser Char Double -> TextParser Decimal
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Double -> Decimal
    Decimal Parser Char Double
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: Decimal -> String
    simpleTypeText (Decimal Double
    s) = Double -> String
    forall a. Show a => a -> String
    show Double
    s -- XXX FIXME: showGFloat?
    instance SimpleType Float where
        acceptingParser :: TextParser Float
    acceptingParser  = TextParser Float
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: Float -> String
    simpleTypeText Float
    x = Float -> String
    forall a. Show a => a -> String
    show Float
    x           -- XXX FIXME: showGFloat?
    instance SimpleType Double where
        acceptingParser :: Parser Char Double
    acceptingParser  = Parser Char Double
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: Double -> String
    simpleTypeText Double
    x = Double -> String
    forall a. Show a => a -> String
    show Double
    x           -- XXX FIXME: showGFloat?

    instance SimpleType Duration where
        acceptingParser :: TextParser Duration
    acceptingParser = (Bool -> Int -> Int -> Int -> Int -> Int -> Float -> Duration)
    -> Parser
         Char (Bool -> Int -> Int -> Int -> Int -> Int -> Float -> Duration)
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Bool -> Int -> Int -> Int -> Int -> Int -> Float -> Duration
    Duration Parser
      Char (Bool -> Int -> Int -> Int -> Int -> Int -> Float -> Duration)
    -> TextParser Bool
    -> Parser
         Char (Int -> Int -> Int -> Int -> Int -> Float -> Duration)
    forall (p :: * -> *) a b. PolyParse p => p (a -> b) -> p a -> p b
    `apply` (do Char -> TextParser Char
    isNext Char
    '-'; Bool -> TextParser Bool
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Bool
    False
                                                   TextParser Bool -> TextParser Bool -> TextParser Bool
    forall t a. Parser t a -> Parser t a -> Parser t a
    `onFail` Bool -> TextParser Bool
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Bool
    True)
                                          Parser Char (Int -> Int -> Int -> Int -> Int -> Float -> Duration)
    -> TextParser Char
    -> Parser
         Char (Int -> Int -> Int -> Int -> Int -> Float -> Duration)
    forall (p :: * -> *) a b. PolyParse p => p a -> p b -> p a
    `discard` Char -> TextParser Char
    isNext Char
    'P'
                                          Parser Char (Int -> Int -> Int -> Int -> Int -> Float -> Duration)
    -> Parser Char Int
    -> Parser Char (Int -> Int -> Int -> Int -> Float -> Duration)
    forall (p :: * -> *) a b. PolyParse p => p (a -> b) -> p a -> p b
    `apply` ((Parser Char Int
    forall a. Integral a => TextParser a
    parseDec Parser Char Int -> TextParser Char -> Parser Char Int
    forall (p :: * -> *) a b. PolyParse p => p a -> p b -> p a
    `discard` Char -> TextParser Char
    isNext Char
    'Y')
                                                   Parser Char Int -> Parser Char Int -> Parser Char Int
    forall t a. Parser t a -> Parser t a -> Parser t a
    `onFail` Int -> Parser Char Int
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Int
    0)
                                          Parser Char (Int -> Int -> Int -> Int -> Float -> Duration)
    -> Parser Char Int
    -> Parser Char (Int -> Int -> Int -> Float -> Duration)
    forall (p :: * -> *) a b. PolyParse p => p (a -> b) -> p a -> p b
    `apply` ((Parser Char Int
    forall a. Integral a => TextParser a
    parseDec Parser Char Int -> TextParser Char -> Parser Char Int
    forall (p :: * -> *) a b. PolyParse p => p a -> p b -> p a
    `discard` Char -> TextParser Char
    isNext Char
    'M')
                                                   Parser Char Int -> Parser Char Int -> Parser Char Int
    forall t a. Parser t a -> Parser t a -> Parser t a
    `onFail` Int -> Parser Char Int
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Int
    0)
                                          Parser Char (Int -> Int -> Int -> Float -> Duration)
    -> Parser Char Int -> Parser Char (Int -> Int -> Float -> Duration)
    forall (p :: * -> *) a b. PolyParse p => p (a -> b) -> p a -> p b
    `apply` ((Parser Char Int
    forall a. Integral a => TextParser a
    parseDec Parser Char Int -> TextParser Char -> Parser Char Int
    forall (p :: * -> *) a b. PolyParse p => p a -> p b -> p a
    `discard` Char -> TextParser Char
    isNext Char
    'D')
                                                   Parser Char Int -> Parser Char Int -> Parser Char Int
    forall t a. Parser t a -> Parser t a -> Parser t a
    `onFail` Int -> Parser Char Int
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Int
    0)
                                          Parser Char (Int -> Int -> Float -> Duration)
    -> TextParser Char -> Parser Char (Int -> Int -> Float -> Duration)
    forall (p :: * -> *) a b. PolyParse p => p a -> p b -> p a
    `discard` (Char -> TextParser Char
    isNext Char
    'T'TextParser Char -> TextParser Char -> TextParser Char
    forall t a. Parser t a -> Parser t a -> Parser t a
    `onFail`Char -> TextParser Char
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Char
    'T')
                                          -- fix: T absent iff H:M:S absent also
                                          Parser Char (Int -> Int -> Float -> Duration)
    -> Parser Char Int -> Parser Char (Int -> Float -> Duration)
    forall (p :: * -> *) a b. PolyParse p => p (a -> b) -> p a -> p b
    `apply` ((Parser Char Int
    forall a. Integral a => TextParser a
    parseDec Parser Char Int -> TextParser Char -> Parser Char Int
    forall (p :: * -> *) a b. PolyParse p => p a -> p b -> p a
    `discard` Char -> TextParser Char
    isNext Char
    'H')
                                                   Parser Char Int -> Parser Char Int -> Parser Char Int
    forall t a. Parser t a -> Parser t a -> Parser t a
    `onFail` Int -> Parser Char Int
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Int
    0)
                                          Parser Char (Int -> Float -> Duration)
    -> Parser Char Int -> Parser Char (Float -> Duration)
    forall (p :: * -> *) a b. PolyParse p => p (a -> b) -> p a -> p b
    `apply` ((Parser Char Int
    forall a. Integral a => TextParser a
    parseDec Parser Char Int -> TextParser Char -> Parser Char Int
    forall (p :: * -> *) a b. PolyParse p => p a -> p b -> p a
    `discard` Char -> TextParser Char
    isNext Char
    'M')
                                                   Parser Char Int -> Parser Char Int -> Parser Char Int
    forall t a. Parser t a -> Parser t a -> Parser t a
    `onFail` Int -> Parser Char Int
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Int
    0)
                                          Parser Char (Float -> Duration)
    -> TextParser Float -> TextParser Duration
    forall (p :: * -> *) a b. PolyParse p => p (a -> b) -> p a -> p b
    `apply` ((TextParser Float
    forall a. RealFrac a => TextParser a
    parseFloat TextParser Float -> TextParser Char -> TextParser Float
    forall (p :: * -> *) a b. PolyParse p => p a -> p b -> p a
    `discard` Char -> TextParser Char
    isNext Char
    'S')
                                                   TextParser Float -> TextParser Float -> TextParser Float
    forall t a. Parser t a -> Parser t a -> Parser t a
    `onFail` Float -> TextParser Float
    forall a. a -> Parser Char a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Float
    0)
        simpleTypeText :: Duration -> String
    simpleTypeText (Duration Bool
    pos Int
    0 Int
    0 Int
    0 Int
    0 Int
    0 Float
    0) = (if Bool
    pos then String
    "" else String
    "-")String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++String
    "PT0S"
        simpleTypeText (Duration Bool
    pos Int
    y Int
    m Int
    d Int
    h Int
    n Float
    s) =
            (if Bool
    pos then String
    "" else String
    "-")String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++String
    "P"String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++Int -> Char -> String
    forall a. (Num a, Eq a, Show a) => a -> Char -> String
    showUnit Int
    y Char
    'Y'String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++Int -> Char -> String
    forall a. (Num a, Eq a, Show a) => a -> Char -> String
    showUnit Int
    m Char
    'M'String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++Int -> Char -> String
    forall a. (Num a, Eq a, Show a) => a -> Char -> String
    showUnit Int
    d Char
    'D'String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++String
    showTime
          where
            showUnit :: (Num a,Eq a,Show a) => a -> Char -> String
            showUnit :: forall a. (Num a, Eq a, Show a) => a -> Char -> String
    showUnit a
    n Char
    u = if a
    n a -> a -> Bool
    forall a. Eq a => a -> a -> Bool
    == a
    0 then String
    "" else a -> String
    forall a. Show a => a -> String
    show a
    n String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ [Char
    u]
            showTime :: String
    showTime = if (Int
    h,Int
    n,Float
    s) (Int, Int, Float) -> (Int, Int, Float) -> Bool
    forall a. Eq a => a -> a -> Bool
    == (Int
    0,Int
    0,Float
    0) then String
    "" else String
    "T"String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++Int -> Char -> String
    forall a. (Num a, Eq a, Show a) => a -> Char -> String
    showUnit Int
    h Char
    'H'String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++Int -> Char -> String
    forall a. (Num a, Eq a, Show a) => a -> Char -> String
    showUnit Int
    n Char
    'M'String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++Float -> Char -> String
    forall a. (Num a, Eq a, Show a) => a -> Char -> String
    showUnit Float
    s Char
    'S'
    instance SimpleType DateTime where
        acceptingParser :: TextParser DateTime
    acceptingParser = (String -> DateTime) -> TextParser String -> TextParser DateTime
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> DateTime
    DateTime (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
     -- acceptingParser = fail "not implemented: simpletype parser for DateTime"
        simpleTypeText :: DateTime -> String
    simpleTypeText (DateTime String
    x) = String
    x
    instance SimpleType Time where
        acceptingParser :: TextParser Time
    acceptingParser = (String -> Time) -> TextParser String -> TextParser Time
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> Time
    Time (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
     -- acceptingParser = fail "not implemented: simpletype parser for Time"
        simpleTypeText :: Time -> String
    simpleTypeText (Time String
    x) = String
    x
    instance SimpleType Date where
        acceptingParser :: TextParser Date
    acceptingParser = (String -> Date) -> TextParser String -> TextParser Date
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> Date
    Date (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
     -- acceptingParser = fail "not implemented: simpletype parser for Date"
        simpleTypeText :: Date -> String
    simpleTypeText (Date String
    x) = String
    x
    instance SimpleType GYearMonth where
        acceptingParser :: TextParser GYearMonth
    acceptingParser = (String -> GYearMonth)
    -> TextParser String -> TextParser GYearMonth
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> GYearMonth
    GYearMonth (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
     -- acceptingParser = fail "not implemented: simpletype parser for GYearMonth"
        simpleTypeText :: GYearMonth -> String
    simpleTypeText (GYearMonth String
    x) = String
    x
    instance SimpleType GYear where
        acceptingParser :: TextParser GYear
    acceptingParser = (String -> GYear) -> TextParser String -> TextParser GYear
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> GYear
    GYear (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
     -- acceptingParser = fail "not implemented: simpletype parser for GYear"
        simpleTypeText :: GYear -> String
    simpleTypeText (GYear String
    x) = String
    x
    instance SimpleType GMonthDay where
        acceptingParser :: TextParser GMonthDay
    acceptingParser = (String -> GMonthDay) -> TextParser String -> TextParser GMonthDay
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> GMonthDay
    GMonthDay (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
     -- acceptingParser = fail "not implemented: simpletype parser for GMonthDay"
        simpleTypeText :: GMonthDay -> String
    simpleTypeText (GMonthDay String
    x) = String
    x
    instance SimpleType GDay where
        acceptingParser :: TextParser GDay
    acceptingParser = (String -> GDay) -> TextParser String -> TextParser GDay
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> GDay
    GDay (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
     -- acceptingParser = fail "not implemented: simpletype parser for GDay"
        simpleTypeText :: GDay -> String
    simpleTypeText (GDay String
    x) = String
    x
    instance SimpleType GMonth where
        acceptingParser :: TextParser GMonth
    acceptingParser = (String -> GMonth) -> TextParser String -> TextParser GMonth
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> GMonth
    GMonth (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
     -- acceptingParser = fail "not implemented: simpletype parser for GMonth"
        simpleTypeText :: GMonth -> String
    simpleTypeText (GMonth String
    x) = String
    x

    -- * Derived builtin types

    newtype NormalizedString = Normalized String    deriving (NormalizedString -> NormalizedString -> Bool
    (NormalizedString -> NormalizedString -> Bool)
    -> (NormalizedString -> NormalizedString -> Bool)
    -> Eq NormalizedString
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: NormalizedString -> NormalizedString -> Bool
    == :: NormalizedString -> NormalizedString -> Bool
    $c/= :: NormalizedString -> NormalizedString -> Bool
    /= :: NormalizedString -> NormalizedString -> Bool
    Eq,Int -> NormalizedString -> ShowS
    [NormalizedString] -> ShowS
    NormalizedString -> String
    (Int -> NormalizedString -> ShowS)
    -> (NormalizedString -> String)
    -> ([NormalizedString] -> ShowS)
    -> Show NormalizedString
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> NormalizedString -> ShowS
    showsPrec :: Int -> NormalizedString -> ShowS
    $cshow :: NormalizedString -> String
    show :: NormalizedString -> String
    $cshowList :: [NormalizedString] -> ShowS
    showList :: [NormalizedString] -> ShowS
    Show)
    newtype Token    = Token    String              deriving (Token -> Token -> Bool
    (Token -> Token -> Bool) -> (Token -> Token -> Bool) -> Eq Token
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Token -> Token -> Bool
    == :: Token -> Token -> Bool
    $c/= :: Token -> Token -> Bool
    /= :: Token -> Token -> Bool
    Eq,Int -> Token -> ShowS
    [Token] -> ShowS
    Token -> String
    (Int -> Token -> ShowS)
    -> (Token -> String) -> ([Token] -> ShowS) -> Show Token
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Token -> ShowS
    showsPrec :: Int -> Token -> ShowS
    $cshow :: Token -> String
    show :: Token -> String
    $cshowList :: [Token] -> ShowS
    showList :: [Token] -> ShowS
    Show)
    newtype Language = Language String              deriving (Language -> Language -> Bool
    (Language -> Language -> Bool)
    -> (Language -> Language -> Bool) -> Eq Language
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Language -> Language -> Bool
    == :: Language -> Language -> Bool
    $c/= :: Language -> Language -> Bool
    /= :: Language -> Language -> Bool
    Eq,Int -> Language -> ShowS
    [Language] -> ShowS
    Language -> String
    (Int -> Language -> ShowS)
    -> (Language -> String) -> ([Language] -> ShowS) -> Show Language
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Language -> ShowS
    showsPrec :: Int -> Language -> ShowS
    $cshow :: Language -> String
    show :: Language -> String
    $cshowList :: [Language] -> ShowS
    showList :: [Language] -> ShowS
    Show)
    newtype Name     = Name     String              deriving (Name -> Name -> Bool
    (Name -> Name -> Bool) -> (Name -> Name -> Bool) -> Eq Name
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Name -> Name -> Bool
    == :: Name -> Name -> Bool
    $c/= :: Name -> Name -> Bool
    /= :: Name -> Name -> Bool
    Eq,Int -> Name -> ShowS
    [Name] -> ShowS
    Name -> String
    (Int -> Name -> ShowS)
    -> (Name -> String) -> ([Name] -> ShowS) -> Show Name
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Name -> ShowS
    showsPrec :: Int -> Name -> ShowS
    $cshow :: Name -> String
    show :: Name -> String
    $cshowList :: [Name] -> ShowS
    showList :: [Name] -> ShowS
    Show)
    newtype NCName   = NCName   String              deriving (NCName -> NCName -> Bool
    (NCName -> NCName -> Bool)
    -> (NCName -> NCName -> Bool) -> Eq NCName
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: NCName -> NCName -> Bool
    == :: NCName -> NCName -> Bool
    $c/= :: NCName -> NCName -> Bool
    /= :: NCName -> NCName -> Bool
    Eq,Int -> NCName -> ShowS
    [NCName] -> ShowS
    NCName -> String
    (Int -> NCName -> ShowS)
    -> (NCName -> String) -> ([NCName] -> ShowS) -> Show NCName
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> NCName -> ShowS
    showsPrec :: Int -> NCName -> ShowS
    $cshow :: NCName -> String
    show :: NCName -> String
    $cshowList :: [NCName] -> ShowS
    showList :: [NCName] -> ShowS
    Show)
    newtype ID       = ID       String              deriving (ID -> ID -> Bool
    (ID -> ID -> Bool) -> (ID -> ID -> Bool) -> Eq ID
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ID -> ID -> Bool
    == :: ID -> ID -> Bool
    $c/= :: ID -> ID -> Bool
    /= :: ID -> ID -> Bool
    Eq,Int -> ID -> ShowS
    [ID] -> ShowS
    ID -> String
    (Int -> ID -> ShowS)
    -> (ID -> String) -> ([ID] -> ShowS) -> Show ID
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ID -> ShowS
    showsPrec :: Int -> ID -> ShowS
    $cshow :: ID -> String
    show :: ID -> String
    $cshowList :: [ID] -> ShowS
    showList :: [ID] -> ShowS
    Show)
    newtype IDREF    = IDREF    String              deriving (IDREF -> IDREF -> Bool
    (IDREF -> IDREF -> Bool) -> (IDREF -> IDREF -> Bool) -> Eq IDREF
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: IDREF -> IDREF -> Bool
    == :: IDREF -> IDREF -> Bool
    $c/= :: IDREF -> IDREF -> Bool
    /= :: IDREF -> IDREF -> Bool
    Eq,Int -> IDREF -> ShowS
    [IDREF] -> ShowS
    IDREF -> String
    (Int -> IDREF -> ShowS)
    -> (IDREF -> String) -> ([IDREF] -> ShowS) -> Show IDREF
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> IDREF -> ShowS
    showsPrec :: Int -> IDREF -> ShowS
    $cshow :: IDREF -> String
    show :: IDREF -> String
    $cshowList :: [IDREF] -> ShowS
    showList :: [IDREF] -> ShowS
    Show)
    newtype IDREFS   = IDREFS   String              deriving (IDREFS -> IDREFS -> Bool
    (IDREFS -> IDREFS -> Bool)
    -> (IDREFS -> IDREFS -> Bool) -> Eq IDREFS
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: IDREFS -> IDREFS -> Bool
    == :: IDREFS -> IDREFS -> Bool
    $c/= :: IDREFS -> IDREFS -> Bool
    /= :: IDREFS -> IDREFS -> Bool
    Eq,Int -> IDREFS -> ShowS
    [IDREFS] -> ShowS
    IDREFS -> String
    (Int -> IDREFS -> ShowS)
    -> (IDREFS -> String) -> ([IDREFS] -> ShowS) -> Show IDREFS
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> IDREFS -> ShowS
    showsPrec :: Int -> IDREFS -> ShowS
    $cshow :: IDREFS -> String
    show :: IDREFS -> String
    $cshowList :: [IDREFS] -> ShowS
    showList :: [IDREFS] -> ShowS
    Show)
    newtype ENTITY   = ENTITY   String              deriving (ENTITY -> ENTITY -> Bool
    (ENTITY -> ENTITY -> Bool)
    -> (ENTITY -> ENTITY -> Bool) -> Eq ENTITY
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ENTITY -> ENTITY -> Bool
    == :: ENTITY -> ENTITY -> Bool
    $c/= :: ENTITY -> ENTITY -> Bool
    /= :: ENTITY -> ENTITY -> Bool
    Eq,Int -> ENTITY -> ShowS
    [ENTITY] -> ShowS
    ENTITY -> String
    (Int -> ENTITY -> ShowS)
    -> (ENTITY -> String) -> ([ENTITY] -> ShowS) -> Show ENTITY
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ENTITY -> ShowS
    showsPrec :: Int -> ENTITY -> ShowS
    $cshow :: ENTITY -> String
    show :: ENTITY -> String
    $cshowList :: [ENTITY] -> ShowS
    showList :: [ENTITY] -> ShowS
    Show)
    newtype ENTITIES = ENTITIES String              deriving (ENTITIES -> ENTITIES -> Bool
    (ENTITIES -> ENTITIES -> Bool)
    -> (ENTITIES -> ENTITIES -> Bool) -> Eq ENTITIES
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ENTITIES -> ENTITIES -> Bool
    == :: ENTITIES -> ENTITIES -> Bool
    $c/= :: ENTITIES -> ENTITIES -> Bool
    /= :: ENTITIES -> ENTITIES -> Bool
    Eq,Int -> ENTITIES -> ShowS
    [ENTITIES] -> ShowS
    ENTITIES -> String
    (Int -> ENTITIES -> ShowS)
    -> (ENTITIES -> String) -> ([ENTITIES] -> ShowS) -> Show ENTITIES
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ENTITIES -> ShowS
    showsPrec :: Int -> ENTITIES -> ShowS
    $cshow :: ENTITIES -> String
    show :: ENTITIES -> String
    $cshowList :: [ENTITIES] -> ShowS
    showList :: [ENTITIES] -> ShowS
    Show)
    newtype NMTOKEN  = NMTOKEN  String              deriving (NMTOKEN -> NMTOKEN -> Bool
    (NMTOKEN -> NMTOKEN -> Bool)
    -> (NMTOKEN -> NMTOKEN -> Bool) -> Eq NMTOKEN
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: NMTOKEN -> NMTOKEN -> Bool
    == :: NMTOKEN -> NMTOKEN -> Bool
    $c/= :: NMTOKEN -> NMTOKEN -> Bool
    /= :: NMTOKEN -> NMTOKEN -> Bool
    Eq,Int -> NMTOKEN -> ShowS
    [NMTOKEN] -> ShowS
    NMTOKEN -> String
    (Int -> NMTOKEN -> ShowS)
    -> (NMTOKEN -> String) -> ([NMTOKEN] -> ShowS) -> Show NMTOKEN
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> NMTOKEN -> ShowS
    showsPrec :: Int -> NMTOKEN -> ShowS
    $cshow :: NMTOKEN -> String
    show :: NMTOKEN -> String
    $cshowList :: [NMTOKEN] -> ShowS
    showList :: [NMTOKEN] -> ShowS
    Show)
    newtype NMTOKENS = NMTOKENS String              deriving (NMTOKENS -> NMTOKENS -> Bool
    (NMTOKENS -> NMTOKENS -> Bool)
    -> (NMTOKENS -> NMTOKENS -> Bool) -> Eq NMTOKENS
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: NMTOKENS -> NMTOKENS -> Bool
    == :: NMTOKENS -> NMTOKENS -> Bool
    $c/= :: NMTOKENS -> NMTOKENS -> Bool
    /= :: NMTOKENS -> NMTOKENS -> Bool
    Eq,Int -> NMTOKENS -> ShowS
    [NMTOKENS] -> ShowS
    NMTOKENS -> String
    (Int -> NMTOKENS -> ShowS)
    -> (NMTOKENS -> String) -> ([NMTOKENS] -> ShowS) -> Show NMTOKENS
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> NMTOKENS -> ShowS
    showsPrec :: Int -> NMTOKENS -> ShowS
    $cshow :: NMTOKENS -> String
    show :: NMTOKENS -> String
    $cshowList :: [NMTOKENS] -> ShowS
    showList :: [NMTOKENS] -> ShowS
    Show)

    instance SimpleType NormalizedString where
        acceptingParser :: TextParser NormalizedString
    acceptingParser = (String -> NormalizedString)
    -> TextParser String -> TextParser NormalizedString
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> NormalizedString
    Normalized (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
        simpleTypeText :: NormalizedString -> String
    simpleTypeText (Normalized String
    x) = String
    x
    instance SimpleType Token where
        acceptingParser :: TextParser Token
    acceptingParser = (String -> Token) -> TextParser String -> TextParser Token
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> Token
    Token (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
        simpleTypeText :: Token -> String
    simpleTypeText (Token String
    x) = String
    x
    instance SimpleType Language where
        acceptingParser :: TextParser Language
    acceptingParser = (String -> Language) -> TextParser String -> TextParser Language
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> Language
    Language (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
        simpleTypeText :: Language -> String
    simpleTypeText (Language String
    x) = String
    x
    instance SimpleType Name where
        acceptingParser :: TextParser Name
    acceptingParser = (String -> Name) -> TextParser String -> TextParser Name
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> Name
    Name (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
        simpleTypeText :: Name -> String
    simpleTypeText (Name String
    x) = String
    x
    instance SimpleType NCName where
        acceptingParser :: TextParser NCName
    acceptingParser = (String -> NCName) -> TextParser String -> TextParser NCName
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> NCName
    NCName (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
        simpleTypeText :: NCName -> String
    simpleTypeText (NCName String
    x) = String
    x
    instance SimpleType ID where
        acceptingParser :: TextParser ID
    acceptingParser = (String -> ID) -> TextParser String -> TextParser ID
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> ID
    ID (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
        simpleTypeText :: ID -> String
    simpleTypeText (ID String
    x) = String
    x
    instance SimpleType IDREF where
        acceptingParser :: TextParser IDREF
    acceptingParser = (String -> IDREF) -> TextParser String -> TextParser IDREF
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> IDREF
    IDREF (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
        simpleTypeText :: IDREF -> String
    simpleTypeText (IDREF String
    x) = String
    x
    instance SimpleType IDREFS where
        acceptingParser :: TextParser IDREFS
    acceptingParser = (String -> IDREFS) -> TextParser String -> TextParser IDREFS
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> IDREFS
    IDREFS (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
        simpleTypeText :: IDREFS -> String
    simpleTypeText (IDREFS String
    x) = String
    x
    instance SimpleType ENTITY where
        acceptingParser :: TextParser ENTITY
    acceptingParser = (String -> ENTITY) -> TextParser String -> TextParser ENTITY
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> ENTITY
    ENTITY (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
        simpleTypeText :: ENTITY -> String
    simpleTypeText (ENTITY String
    x) = String
    x
    instance SimpleType ENTITIES where
        acceptingParser :: TextParser ENTITIES
    acceptingParser = (String -> ENTITIES) -> TextParser String -> TextParser ENTITIES
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> ENTITIES
    ENTITIES (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
        simpleTypeText :: ENTITIES -> String
    simpleTypeText (ENTITIES String
    x) = String
    x
    instance SimpleType NMTOKEN where
        acceptingParser :: TextParser NMTOKEN
    acceptingParser = (String -> NMTOKEN) -> TextParser String -> TextParser NMTOKEN
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> NMTOKEN
    NMTOKEN (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
        simpleTypeText :: NMTOKEN -> String
    simpleTypeText (NMTOKEN String
    x) = String
    x
    instance SimpleType NMTOKENS where
        acceptingParser :: TextParser NMTOKENS
    acceptingParser = (String -> NMTOKENS) -> TextParser String -> TextParser NMTOKENS
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> NMTOKENS
    NMTOKENS (TextParser Char -> TextParser String
    forall a. Parser Char a -> Parser Char [a]
    forall (f :: * -> *) a. Alternative f => f a -> f [a]
    many TextParser Char
    forall t. Parser t t
    next)
        simpleTypeText :: NMTOKENS -> String
    simpleTypeText (NMTOKENS String
    x) = String
    x

    --data Integer
    newtype NonPositiveInteger = NonPos   Integer   deriving (NonPositiveInteger -> NonPositiveInteger -> Bool
    (NonPositiveInteger -> NonPositiveInteger -> Bool)
    -> (NonPositiveInteger -> NonPositiveInteger -> Bool)
    -> Eq NonPositiveInteger
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: NonPositiveInteger -> NonPositiveInteger -> Bool
    == :: NonPositiveInteger -> NonPositiveInteger -> Bool
    $c/= :: NonPositiveInteger -> NonPositiveInteger -> Bool
    /= :: NonPositiveInteger -> NonPositiveInteger -> Bool
    Eq,Int -> NonPositiveInteger -> ShowS
    [NonPositiveInteger] -> ShowS
    NonPositiveInteger -> String
    (Int -> NonPositiveInteger -> ShowS)
    -> (NonPositiveInteger -> String)
    -> ([NonPositiveInteger] -> ShowS)
    -> Show NonPositiveInteger
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> NonPositiveInteger -> ShowS
    showsPrec :: Int -> NonPositiveInteger -> ShowS
    $cshow :: NonPositiveInteger -> String
    show :: NonPositiveInteger -> String
    $cshowList :: [NonPositiveInteger] -> ShowS
    showList :: [NonPositiveInteger] -> ShowS
    Show)
    newtype NegativeInteger    = Negative Integer   deriving (NegativeInteger -> NegativeInteger -> Bool
    (NegativeInteger -> NegativeInteger -> Bool)
    -> (NegativeInteger -> NegativeInteger -> Bool)
    -> Eq NegativeInteger
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: NegativeInteger -> NegativeInteger -> Bool
    == :: NegativeInteger -> NegativeInteger -> Bool
    $c/= :: NegativeInteger -> NegativeInteger -> Bool
    /= :: NegativeInteger -> NegativeInteger -> Bool
    Eq,Int -> NegativeInteger -> ShowS
    [NegativeInteger] -> ShowS
    NegativeInteger -> String
    (Int -> NegativeInteger -> ShowS)
    -> (NegativeInteger -> String)
    -> ([NegativeInteger] -> ShowS)
    -> Show NegativeInteger
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> NegativeInteger -> ShowS
    showsPrec :: Int -> NegativeInteger -> ShowS
    $cshow :: NegativeInteger -> String
    show :: NegativeInteger -> String
    $cshowList :: [NegativeInteger] -> ShowS
    showList :: [NegativeInteger] -> ShowS
    Show)
    newtype Long               = Long     Int64     deriving (Long -> Long -> Bool
    (Long -> Long -> Bool) -> (Long -> Long -> Bool) -> Eq Long
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Long -> Long -> Bool
    == :: Long -> Long -> Bool
    $c/= :: Long -> Long -> Bool
    /= :: Long -> Long -> Bool
    Eq,Int -> Long -> ShowS
    [Long] -> ShowS
    Long -> String
    (Int -> Long -> ShowS)
    -> (Long -> String) -> ([Long] -> ShowS) -> Show Long
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Long -> ShowS
    showsPrec :: Int -> Long -> ShowS
    $cshow :: Long -> String
    show :: Long -> String
    $cshowList :: [Long] -> ShowS
    showList :: [Long] -> ShowS
    Show)
    --data Int
    newtype Short              = Short    Int16     deriving (Short -> Short -> Bool
    (Short -> Short -> Bool) -> (Short -> Short -> Bool) -> Eq Short
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Short -> Short -> Bool
    == :: Short -> Short -> Bool
    $c/= :: Short -> Short -> Bool
    /= :: Short -> Short -> Bool
    Eq,Int -> Short -> ShowS
    [Short] -> ShowS
    Short -> String
    (Int -> Short -> ShowS)
    -> (Short -> String) -> ([Short] -> ShowS) -> Show Short
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Short -> ShowS
    showsPrec :: Int -> Short -> ShowS
    $cshow :: Short -> String
    show :: Short -> String
    $cshowList :: [Short] -> ShowS
    showList :: [Short] -> ShowS
    Show)
    newtype Byte               = Byte     Int8      deriving (Byte -> Byte -> Bool
    (Byte -> Byte -> Bool) -> (Byte -> Byte -> Bool) -> Eq Byte
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Byte -> Byte -> Bool
    == :: Byte -> Byte -> Bool
    $c/= :: Byte -> Byte -> Bool
    /= :: Byte -> Byte -> Bool
    Eq,Int -> Byte -> ShowS
    [Byte] -> ShowS
    Byte -> String
    (Int -> Byte -> ShowS)
    -> (Byte -> String) -> ([Byte] -> ShowS) -> Show Byte
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Byte -> ShowS
    showsPrec :: Int -> Byte -> ShowS
    $cshow :: Byte -> String
    show :: Byte -> String
    $cshowList :: [Byte] -> ShowS
    showList :: [Byte] -> ShowS
    Show)
    newtype NonNegativeInteger = NonNeg   Integer   deriving (NonNegativeInteger -> NonNegativeInteger -> Bool
    (NonNegativeInteger -> NonNegativeInteger -> Bool)
    -> (NonNegativeInteger -> NonNegativeInteger -> Bool)
    -> Eq NonNegativeInteger
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: NonNegativeInteger -> NonNegativeInteger -> Bool
    == :: NonNegativeInteger -> NonNegativeInteger -> Bool
    $c/= :: NonNegativeInteger -> NonNegativeInteger -> Bool
    /= :: NonNegativeInteger -> NonNegativeInteger -> Bool
    Eq,Int -> NonNegativeInteger -> ShowS
    [NonNegativeInteger] -> ShowS
    NonNegativeInteger -> String
    (Int -> NonNegativeInteger -> ShowS)
    -> (NonNegativeInteger -> String)
    -> ([NonNegativeInteger] -> ShowS)
    -> Show NonNegativeInteger
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> NonNegativeInteger -> ShowS
    showsPrec :: Int -> NonNegativeInteger -> ShowS
    $cshow :: NonNegativeInteger -> String
    show :: NonNegativeInteger -> String
    $cshowList :: [NonNegativeInteger] -> ShowS
    showList :: [NonNegativeInteger] -> ShowS
    Show)
    newtype UnsignedLong       = ULong    Word64    deriving (UnsignedLong -> UnsignedLong -> Bool
    (UnsignedLong -> UnsignedLong -> Bool)
    -> (UnsignedLong -> UnsignedLong -> Bool) -> Eq UnsignedLong
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: UnsignedLong -> UnsignedLong -> Bool
    == :: UnsignedLong -> UnsignedLong -> Bool
    $c/= :: UnsignedLong -> UnsignedLong -> Bool
    /= :: UnsignedLong -> UnsignedLong -> Bool
    Eq,Int -> UnsignedLong -> ShowS
    [UnsignedLong] -> ShowS
    UnsignedLong -> String
    (Int -> UnsignedLong -> ShowS)
    -> (UnsignedLong -> String)
    -> ([UnsignedLong] -> ShowS)
    -> Show UnsignedLong
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> UnsignedLong -> ShowS
    showsPrec :: Int -> UnsignedLong -> ShowS
    $cshow :: UnsignedLong -> String
    show :: UnsignedLong -> String
    $cshowList :: [UnsignedLong] -> ShowS
    showList :: [UnsignedLong] -> ShowS
    Show)
    newtype UnsignedInt        = UInt     Word32    deriving (UnsignedInt -> UnsignedInt -> Bool
    (UnsignedInt -> UnsignedInt -> Bool)
    -> (UnsignedInt -> UnsignedInt -> Bool) -> Eq UnsignedInt
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: UnsignedInt -> UnsignedInt -> Bool
    == :: UnsignedInt -> UnsignedInt -> Bool
    $c/= :: UnsignedInt -> UnsignedInt -> Bool
    /= :: UnsignedInt -> UnsignedInt -> Bool
    Eq,Int -> UnsignedInt -> ShowS
    [UnsignedInt] -> ShowS
    UnsignedInt -> String
    (Int -> UnsignedInt -> ShowS)
    -> (UnsignedInt -> String)
    -> ([UnsignedInt] -> ShowS)
    -> Show UnsignedInt
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> UnsignedInt -> ShowS
    showsPrec :: Int -> UnsignedInt -> ShowS
    $cshow :: UnsignedInt -> String
    show :: UnsignedInt -> String
    $cshowList :: [UnsignedInt] -> ShowS
    showList :: [UnsignedInt] -> ShowS
    Show)
    newtype UnsignedShort      = UShort   Word16    deriving (UnsignedShort -> UnsignedShort -> Bool
    (UnsignedShort -> UnsignedShort -> Bool)
    -> (UnsignedShort -> UnsignedShort -> Bool) -> Eq UnsignedShort
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: UnsignedShort -> UnsignedShort -> Bool
    == :: UnsignedShort -> UnsignedShort -> Bool
    $c/= :: UnsignedShort -> UnsignedShort -> Bool
    /= :: UnsignedShort -> UnsignedShort -> Bool
    Eq,Int -> UnsignedShort -> ShowS
    [UnsignedShort] -> ShowS
    UnsignedShort -> String
    (Int -> UnsignedShort -> ShowS)
    -> (UnsignedShort -> String)
    -> ([UnsignedShort] -> ShowS)
    -> Show UnsignedShort
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> UnsignedShort -> ShowS
    showsPrec :: Int -> UnsignedShort -> ShowS
    $cshow :: UnsignedShort -> String
    show :: UnsignedShort -> String
    $cshowList :: [UnsignedShort] -> ShowS
    showList :: [UnsignedShort] -> ShowS
    Show)
    newtype UnsignedByte       = UByte    Word8     deriving (UnsignedByte -> UnsignedByte -> Bool
    (UnsignedByte -> UnsignedByte -> Bool)
    -> (UnsignedByte -> UnsignedByte -> Bool) -> Eq UnsignedByte
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: UnsignedByte -> UnsignedByte -> Bool
    == :: UnsignedByte -> UnsignedByte -> Bool
    $c/= :: UnsignedByte -> UnsignedByte -> Bool
    /= :: UnsignedByte -> UnsignedByte -> Bool
    Eq,Int -> UnsignedByte -> ShowS
    [UnsignedByte] -> ShowS
    UnsignedByte -> String
    (Int -> UnsignedByte -> ShowS)
    -> (UnsignedByte -> String)
    -> ([UnsignedByte] -> ShowS)
    -> Show UnsignedByte
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> UnsignedByte -> ShowS
    showsPrec :: Int -> UnsignedByte -> ShowS
    $cshow :: UnsignedByte -> String
    show :: UnsignedByte -> String
    $cshowList :: [UnsignedByte] -> ShowS
    showList :: [UnsignedByte] -> ShowS
    Show)
    newtype PositiveInteger    = Positive Integer   deriving (PositiveInteger -> PositiveInteger -> Bool
    (PositiveInteger -> PositiveInteger -> Bool)
    -> (PositiveInteger -> PositiveInteger -> Bool)
    -> Eq PositiveInteger
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: PositiveInteger -> PositiveInteger -> Bool
    == :: PositiveInteger -> PositiveInteger -> Bool
    $c/= :: PositiveInteger -> PositiveInteger -> Bool
    /= :: PositiveInteger -> PositiveInteger -> Bool
    Eq,Int -> PositiveInteger -> ShowS
    [PositiveInteger] -> ShowS
    PositiveInteger -> String
    (Int -> PositiveInteger -> ShowS)
    -> (PositiveInteger -> String)
    -> ([PositiveInteger] -> ShowS)
    -> Show PositiveInteger
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> PositiveInteger -> ShowS
    showsPrec :: Int -> PositiveInteger -> ShowS
    $cshow :: PositiveInteger -> String
    show :: PositiveInteger -> String
    $cshowList :: [PositiveInteger] -> ShowS
    showList :: [PositiveInteger] -> ShowS
    Show)

    instance SimpleType Integer where
        acceptingParser :: TextParser Integer
    acceptingParser = TextParser Integer
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: Integer -> String
    simpleTypeText  = Integer -> String
    forall a. Show a => a -> String
    show
    instance SimpleType NonPositiveInteger where
        acceptingParser :: TextParser NonPositiveInteger
    acceptingParser = (Integer -> NonPositiveInteger)
    -> TextParser Integer -> TextParser NonPositiveInteger
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Integer -> NonPositiveInteger
    NonPos TextParser Integer
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: NonPositiveInteger -> String
    simpleTypeText (NonPos Integer
    x) = Integer -> String
    forall a. Show a => a -> String
    show Integer
    x
    instance SimpleType NegativeInteger where
        acceptingParser :: TextParser NegativeInteger
    acceptingParser = (Integer -> NegativeInteger)
    -> TextParser Integer -> TextParser NegativeInteger
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Integer -> NegativeInteger
    Negative TextParser Integer
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: NegativeInteger -> String
    simpleTypeText (Negative Integer
    x) = Integer -> String
    forall a. Show a => a -> String
    show Integer
    x
    instance SimpleType Long where
        acceptingParser :: TextParser Long
    acceptingParser = (Integer -> Long) -> TextParser Integer -> TextParser Long
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (Int64 -> Long
    Long (Int64 -> Long) -> (Integer -> Int64) -> Integer -> Long
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Integer -> Int64
    forall a. Num a => Integer -> a
    fromInteger) TextParser Integer
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: Long -> String
    simpleTypeText (Long Int64
    x) = Int64 -> String
    forall a. Show a => a -> String
    show Int64
    x
    instance SimpleType Int where
        acceptingParser :: Parser Char Int
    acceptingParser = Parser Char Int
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: Int -> String
    simpleTypeText  = Int -> String
    forall a. Show a => a -> String
    show
    instance SimpleType Short where
        acceptingParser :: TextParser Short
    acceptingParser = (Integer -> Short) -> TextParser Integer -> TextParser Short
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (Int16 -> Short
    Short (Int16 -> Short) -> (Integer -> Int16) -> Integer -> Short
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Integer -> Int16
    forall a. Num a => Integer -> a
    fromInteger) TextParser Integer
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: Short -> String
    simpleTypeText (Short Int16
    x) = Int16 -> String
    forall a. Show a => a -> String
    show Int16
    x
    instance SimpleType Byte where
        acceptingParser :: TextParser Byte
    acceptingParser = (Integer -> Byte) -> TextParser Integer -> TextParser Byte
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (Int8 -> Byte
    Byte (Int8 -> Byte) -> (Integer -> Int8) -> Integer -> Byte
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Integer -> Int8
    forall a. Num a => Integer -> a
    fromInteger) TextParser Integer
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: Byte -> String
    simpleTypeText (Byte Int8
    x) = Int8 -> String
    forall a. Show a => a -> String
    show Int8
    x
    instance SimpleType NonNegativeInteger where
        acceptingParser :: TextParser NonNegativeInteger
    acceptingParser = (Integer -> NonNegativeInteger)
    -> TextParser Integer -> TextParser NonNegativeInteger
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Integer -> NonNegativeInteger
    NonNeg TextParser Integer
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: NonNegativeInteger -> String
    simpleTypeText (NonNeg Integer
    x) = Integer -> String
    forall a. Show a => a -> String
    show Integer
    x
    instance SimpleType UnsignedLong where
        acceptingParser :: TextParser UnsignedLong
    acceptingParser = (Integer -> UnsignedLong)
    -> TextParser Integer -> TextParser UnsignedLong
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (Word64 -> UnsignedLong
    ULong (Word64 -> UnsignedLong)
    -> (Integer -> Word64) -> Integer -> UnsignedLong
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Integer -> Word64
    forall a. Num a => Integer -> a
    fromInteger) TextParser Integer
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: UnsignedLong -> String
    simpleTypeText (ULong Word64
    x) = Word64 -> String
    forall a. Show a => a -> String
    show Word64
    x
    instance SimpleType UnsignedInt where
        acceptingParser :: TextParser UnsignedInt
    acceptingParser = (Integer -> UnsignedInt)
    -> TextParser Integer -> TextParser UnsignedInt
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (Word32 -> UnsignedInt
    UInt (Word32 -> UnsignedInt)
    -> (Integer -> Word32) -> Integer -> UnsignedInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Integer -> Word32
    forall a. Num a => Integer -> a
    fromInteger) TextParser Integer
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: UnsignedInt -> String
    simpleTypeText (UInt Word32
    x) = Word32 -> String
    forall a. Show a => a -> String
    show Word32
    x
    instance SimpleType UnsignedShort where
        acceptingParser :: TextParser UnsignedShort
    acceptingParser = (Integer -> UnsignedShort)
    -> TextParser Integer -> TextParser UnsignedShort
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (Word16 -> UnsignedShort
    UShort (Word16 -> UnsignedShort)
    -> (Integer -> Word16) -> Integer -> UnsignedShort
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Integer -> Word16
    forall a. Num a => Integer -> a
    fromInteger) TextParser Integer
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: UnsignedShort -> String
    simpleTypeText (UShort Word16
    x) = Word16 -> String
    forall a. Show a => a -> String
    show Word16
    x
    instance SimpleType UnsignedByte where
        acceptingParser :: TextParser UnsignedByte
    acceptingParser = (Integer -> UnsignedByte)
    -> TextParser Integer -> TextParser UnsignedByte
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (Word8 -> UnsignedByte
    UByte (Word8 -> UnsignedByte)
    -> (Integer -> Word8) -> Integer -> UnsignedByte
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Integer -> Word8
    forall a. Num a => Integer -> a
    fromInteger) TextParser Integer
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: UnsignedByte -> String
    simpleTypeText (UByte Word8
    x) = Word8 -> String
    forall a. Show a => a -> String
    show Word8
    x
    instance SimpleType PositiveInteger where
        acceptingParser :: TextParser PositiveInteger
    acceptingParser = (Integer -> PositiveInteger)
    -> TextParser Integer -> TextParser PositiveInteger
    forall a b. (a -> b) -> Parser Char a -> Parser Char b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Integer -> PositiveInteger
    Positive TextParser Integer
    forall a. Parse a => TextParser a
    parse
        simpleTypeText :: PositiveInteger -> String
    simpleTypeText (Positive Integer
    x) = Integer -> String
    forall a. Show a => a -> String
    show Integer
    x