hxt-relaxng-9.1.5.5: The HXT RelaxNG validator
Safe HaskellNone
LanguageHaskell98

Text.XML.HXT.RelaxNG.DataTypeLibUtils

Description

exports helper functions for the integration of new datatype-libraries

Synopsis

Documentation

errorMsgEqual :: DatatypeName -> String -> String -> String Source #

errorMsgDataTypeNotAllowed :: String -> String -> [(String, String)] -> String -> String Source #

errorMsgDataTypeNotAllowed0 :: String -> String -> String Source #

errorMsgDataTypeNotAllowed2 :: String -> String -> String -> String -> String Source #

errorMsgDataLibQName :: String -> String -> String -> String Source #

errorMsgParam :: LocalName -> String -> String -> String Source #

Error Message for the equality test of two datatype values

  • 1.parameter : datatype
  • 2.parameter : datatype value
  • 3.parameter : datatype value

example:

errorMsgEqual "Int" "21" "42" -> "Datatype Int with value = 21 expected, but value = 42 found"

rng_length :: String Source #

class ArrowZero a => ArrowPlus (a :: Type -> Type -> Type) where #

Methods

(<+>) :: a b c -> a b c -> a b c #

Instances

Instances details
ArrowPlus IOLA 
Instance details

Defined in Control.Arrow.IOListArrow

Methods

(<+>) :: IOLA b c -> IOLA b c -> IOLA b c #

ArrowPlus LA 
Instance details

Defined in Control.Arrow.ListArrow

Methods

(<+>) :: LA b c -> LA b c -> LA b c #

ArrowPlus CheckA Source # 
Instance details

Defined in Text.XML.HXT.RelaxNG.DataTypeLibUtils

Methods

(<+>) :: CheckA b c -> CheckA b c -> CheckA b c #

MonadPlus m => ArrowPlus (Kleisli m) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

(<+>) :: Kleisli m b c -> Kleisli m b c -> Kleisli m b c #

ArrowPlus (IOSLA s) 
Instance details

Defined in Control.Arrow.IOStateListArrow

Methods

(<+>) :: IOSLA s b c -> IOSLA s b c -> IOSLA s b c #

ArrowPlus (SLA s) 
Instance details

Defined in Control.Arrow.StateListArrow

Methods

(<+>) :: SLA s b c -> SLA s b c -> SLA s b c #

(>>>) :: forall {k} cat (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c #

(<<^) :: Arrow a => a c d -> (b -> c) -> a b d #

(>>^) :: Arrow a => a b c -> (c -> d) -> a b d #

(^<<) :: Arrow a => (c -> d) -> a b c -> a b d #

(^>>) :: Arrow a => (b -> c) -> a c d -> a b d #

leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d) #

returnA :: Arrow a => a b b #

(<<<) :: forall {k} cat (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c #

class Category a => Arrow (a :: Type -> Type -> Type) where #

Minimal complete definition

arr, (first | (***))

Methods

arr :: (b -> c) -> a b c #

first :: a b c -> a (b, d) (c, d) #

second :: a b c -> a (d, b) (d, c) #

(***) :: a b c -> a b' c' -> a (b, b') (c, c') #

(&&&) :: a b c -> a b c' -> a b (c, c') #

Instances

Instances details
Arrow IOLA 
Instance details

Defined in Control.Arrow.IOListArrow

Methods

arr :: (b -> c) -> IOLA b c #

first :: IOLA b c -> IOLA (b, d) (c, d) #

second :: IOLA b c -> IOLA (d, b) (d, c) #

(***) :: IOLA b c -> IOLA b' c' -> IOLA (b, b') (c, c') #

(&&&) :: IOLA b c -> IOLA b c' -> IOLA b (c, c') #

Arrow LA 
Instance details

Defined in Control.Arrow.ListArrow

Methods

arr :: (b -> c) -> LA b c #

first :: LA b c -> LA (b, d) (c, d) #

second :: LA b c -> LA (d, b) (d, c) #

(***) :: LA b c -> LA b' c' -> LA (b, b') (c, c') #

(&&&) :: LA b c -> LA b c' -> LA b (c, c') #

Arrow CheckA Source # 
Instance details

Defined in Text.XML.HXT.RelaxNG.DataTypeLibUtils

Methods

arr :: (b -> c) -> CheckA b c #

first :: CheckA b c -> CheckA (b, d) (c, d) #

second :: CheckA b c -> CheckA (d, b) (d, c) #

(***) :: CheckA b c -> CheckA b' c' -> CheckA (b, b') (c, c') #

(&&&) :: CheckA b c -> CheckA b c' -> CheckA b (c, c') #

Monad m => Arrow (Kleisli m) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

arr :: (b -> c) -> Kleisli m b c #

first :: Kleisli m b c -> Kleisli m (b, d) (c, d) #

second :: Kleisli m b c -> Kleisli m (d, b) (d, c) #

(***) :: Kleisli m b c -> Kleisli m b' c' -> Kleisli m (b, b') (c, c') #

(&&&) :: Kleisli m b c -> Kleisli m b c' -> Kleisli m b (c, c') #

Arrow (IOSLA s) 
Instance details

Defined in Control.Arrow.IOStateListArrow

Methods

arr :: (b -> c) -> IOSLA s b c #

first :: IOSLA s b c -> IOSLA s (b, d) (c, d) #

second :: IOSLA s b c -> IOSLA s (d, b) (d, c) #

(***) :: IOSLA s b c -> IOSLA s b' c' -> IOSLA s (b, b') (c, c') #

(&&&) :: IOSLA s b c -> IOSLA s b c' -> IOSLA s b (c, c') #

Arrow (SLA s) 
Instance details

Defined in Control.Arrow.StateListArrow

Methods

arr :: (b -> c) -> SLA s b c #

first :: SLA s b c -> SLA s (b, d) (c, d) #

second :: SLA s b c -> SLA s (d, b) (d, c) #

(***) :: SLA s b c -> SLA s b' c' -> SLA s (b, b') (c, c') #

(&&&) :: SLA s b c -> SLA s b c' -> SLA s b (c, c') #

Arrow (->) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

arr :: (b -> c) -> b -> c #

first :: (b -> c) -> (b, d) -> (c, d) #

second :: (b -> c) -> (d, b) -> (d, c) #

(***) :: (b -> c) -> (b' -> c') -> (b, b') -> (c, c') #

(&&&) :: (b -> c) -> (b -> c') -> b -> (c, c') #

class Arrow a => ArrowApply (a :: Type -> Type -> Type) where #

Methods

app :: a (a b c, b) c #

Instances

Instances details
ArrowApply IOLA 
Instance details

Defined in Control.Arrow.IOListArrow

Methods

app :: IOLA (IOLA b c, b) c #

ArrowApply LA 
Instance details

Defined in Control.Arrow.ListArrow

Methods

app :: LA (LA b c, b) c #

Monad m => ArrowApply (Kleisli m) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

app :: Kleisli m (Kleisli m b c, b) c #

ArrowApply (IOSLA s) 
Instance details

Defined in Control.Arrow.IOStateListArrow

Methods

app :: IOSLA s (IOSLA s b c, b) c #

ArrowApply (SLA s) 
Instance details

Defined in Control.Arrow.StateListArrow

Methods

app :: SLA s (SLA s b c, b) c #

ArrowApply (->) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

app :: (b -> c, b) -> c #

class Arrow a => ArrowChoice (a :: Type -> Type -> Type) where #

Minimal complete definition

(left | (+++))

Methods

left :: a b c -> a (Either b d) (Either c d) #

right :: a b c -> a (Either d b) (Either d c) #

(+++) :: a b c -> a b' c' -> a (Either b b') (Either c c') #

(|||) :: a b d -> a c d -> a (Either b c) d #

Instances

Instances details
ArrowChoice IOLA 
Instance details

Defined in Control.Arrow.IOListArrow

Methods

left :: IOLA b c -> IOLA (Either b d) (Either c d) #

right :: IOLA b c -> IOLA (Either d b) (Either d c) #

(+++) :: IOLA b c -> IOLA b' c' -> IOLA (Either b b') (Either c c') #

(|||) :: IOLA b d -> IOLA c d -> IOLA (Either b c) d #

ArrowChoice LA 
Instance details

Defined in Control.Arrow.ListArrow

Methods

left :: LA b c -> LA (Either b d) (Either c d) #

right :: LA b c -> LA (Either d b) (Either d c) #

(+++) :: LA b c -> LA b' c' -> LA (Either b b') (Either c c') #

(|||) :: LA b d -> LA c d -> LA (Either b c) d #

Monad m => ArrowChoice (Kleisli m) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

left :: Kleisli m b c -> Kleisli m (Either b d) (Either c d) #

right :: Kleisli m b c -> Kleisli m (Either d b) (Either d c) #

(+++) :: Kleisli m b c -> Kleisli m b' c' -> Kleisli m (Either b b') (Either c c') #

(|||) :: Kleisli m b d -> Kleisli m c d -> Kleisli m (Either b c) d #

ArrowChoice (IOSLA s) 
Instance details

Defined in Control.Arrow.IOStateListArrow

Methods

left :: IOSLA s b c -> IOSLA s (Either b d) (Either c d) #

right :: IOSLA s b c -> IOSLA s (Either d b) (Either d c) #

(+++) :: IOSLA s b c -> IOSLA s b' c' -> IOSLA s (Either b b') (Either c c') #

(|||) :: IOSLA s b d -> IOSLA s c d -> IOSLA s (Either b c) d #

ArrowChoice (SLA s) 
Instance details

Defined in Control.Arrow.StateListArrow

Methods

left :: SLA s b c -> SLA s (Either b d) (Either c d) #

right :: SLA s b c -> SLA s (Either d b) (Either d c) #

(+++) :: SLA s b c -> SLA s b' c' -> SLA s (Either b b') (Either c c') #

(|||) :: SLA s b d -> SLA s c d -> SLA s (Either b c) d #

ArrowChoice (->) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

left :: (b -> c) -> Either b d -> Either c d #

right :: (b -> c) -> Either d b -> Either d c #

(+++) :: (b -> c) -> (b' -> c') -> Either b b' -> Either c c' #

(|||) :: (b -> d) -> (c -> d) -> Either b c -> d #

class Arrow a => ArrowLoop (a :: Type -> Type -> Type) where #

Methods

loop :: a (b, d) (c, d) -> a b c #

Instances

Instances details
MonadFix m => ArrowLoop (Kleisli m) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

loop :: Kleisli m (b, d) (c, d) -> Kleisli m b c #

ArrowLoop (->) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

loop :: ((b, d) -> (c, d)) -> b -> c #

newtype ArrowMonad (a :: Type -> Type -> Type) b #

Constructors

ArrowMonad (a () b) 

Instances

Instances details
ArrowPlus a => Alternative (ArrowMonad a) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

empty :: ArrowMonad a a0

(<|>) :: ArrowMonad a a0 -> ArrowMonad a a0 -> ArrowMonad a a0

some :: ArrowMonad a a0 -> ArrowMonad a [a0]

many :: ArrowMonad a a0 -> ArrowMonad a [a0]

Arrow a => Applicative (ArrowMonad a) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

pure :: a0 -> ArrowMonad a a0

(<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b

liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c

(*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b

(<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0

Arrow a => Functor (ArrowMonad a) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

fmap :: (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b

(<$) :: a0 -> ArrowMonad a b -> ArrowMonad a a0

ArrowApply a => Monad (ArrowMonad a) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

(>>=) :: ArrowMonad a a0 -> (a0 -> ArrowMonad a b) -> ArrowMonad a b

(>>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b

return :: a0 -> ArrowMonad a a0

(ArrowApply a, ArrowPlus a) => MonadPlus (ArrowMonad a) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

mzero :: ArrowMonad a a0

mplus :: ArrowMonad a a0 -> ArrowMonad a a0 -> ArrowMonad a a0

class Arrow a => ArrowZero (a :: Type -> Type -> Type) where #

Methods

zeroArrow :: a b c #

Instances

Instances details
ArrowZero IOLA 
Instance details

Defined in Control.Arrow.IOListArrow

Methods

zeroArrow :: IOLA b c #

ArrowZero LA 
Instance details

Defined in Control.Arrow.ListArrow

Methods

zeroArrow :: LA b c #

ArrowZero CheckA Source # 
Instance details

Defined in Text.XML.HXT.RelaxNG.DataTypeLibUtils

Methods

zeroArrow :: CheckA b c #

MonadPlus m => ArrowZero (Kleisli m) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

zeroArrow :: Kleisli m b c #

ArrowZero (IOSLA s) 
Instance details

Defined in Control.Arrow.IOStateListArrow

Methods

zeroArrow :: IOSLA s b c #

ArrowZero (SLA s) 
Instance details

Defined in Control.Arrow.StateListArrow

Methods

zeroArrow :: SLA s b c #

newtype Kleisli (m :: Type -> Type) a b #

Constructors

Kleisli 

Fields

Instances

Instances details
Monad m => Category (Kleisli m :: Type -> Type -> Type) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

id :: Kleisli m a a

(.) :: Kleisli m b c -> Kleisli m a b -> Kleisli m a c

Generic1 (Kleisli m a :: Type -> Type) 
Instance details

Defined in GHC.Internal.Control.Arrow

Associated Types

type Rep1 (Kleisli m a :: Type -> Type) 
Instance details

Defined in GHC.Internal.Control.Arrow

type Rep1 (Kleisli m a :: Type -> Type) = D1 ('MetaData "Kleisli" "GHC.Internal.Control.Arrow" "ghc-internal" 'True) (C1 ('MetaCons "Kleisli" 'PrefixI 'True) (S1 ('MetaSel ('Just "runKleisli") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) ((FUN 'Many a :: Type -> Type) :.: Rec1 m)))

Methods

from1 :: Kleisli m a a0 -> Rep1 (Kleisli m a) a0

to1 :: Rep1 (Kleisli m a) a0 -> Kleisli m a a0

Monad m => Arrow (Kleisli m) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

arr :: (b -> c) -> Kleisli m b c #

first :: Kleisli m b c -> Kleisli m (b, d) (c, d) #

second :: Kleisli m b c -> Kleisli m (d, b) (d, c) #

(***) :: Kleisli m b c -> Kleisli m b' c' -> Kleisli m (b, b') (c, c') #

(&&&) :: Kleisli m b c -> Kleisli m b c' -> Kleisli m b (c, c') #

Monad m => ArrowApply (Kleisli m) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

app :: Kleisli m (Kleisli m b c, b) c #

Monad m => ArrowChoice (Kleisli m) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

left :: Kleisli m b c -> Kleisli m (Either b d) (Either c d) #

right :: Kleisli m b c -> Kleisli m (Either d b) (Either d c) #

(+++) :: Kleisli m b c -> Kleisli m b' c' -> Kleisli m (Either b b') (Either c c') #

(|||) :: Kleisli m b d -> Kleisli m c d -> Kleisli m (Either b c) d #

MonadFix m => ArrowLoop (Kleisli m) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

loop :: Kleisli m (b, d) (c, d) -> Kleisli m b c #

MonadPlus m => ArrowPlus (Kleisli m) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

(<+>) :: Kleisli m b c -> Kleisli m b c -> Kleisli m b c #

MonadPlus m => ArrowZero (Kleisli m) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

zeroArrow :: Kleisli m b c #

Alternative m => Alternative (Kleisli m a) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

empty :: Kleisli m a a0

(<|>) :: Kleisli m a a0 -> Kleisli m a a0 -> Kleisli m a a0

some :: Kleisli m a a0 -> Kleisli m a [a0]

many :: Kleisli m a a0 -> Kleisli m a [a0]

Applicative m => Applicative (Kleisli m a) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

pure :: a0 -> Kleisli m a a0

(<*>) :: Kleisli m a (a0 -> b) -> Kleisli m a a0 -> Kleisli m a b

liftA2 :: (a0 -> b -> c) -> Kleisli m a a0 -> Kleisli m a b -> Kleisli m a c

(*>) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a b

(<*) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a a0

Functor m => Functor (Kleisli m a) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

fmap :: (a0 -> b) -> Kleisli m a a0 -> Kleisli m a b

(<$) :: a0 -> Kleisli m a b -> Kleisli m a a0

Monad m => Monad (Kleisli m a) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

(>>=) :: Kleisli m a a0 -> (a0 -> Kleisli m a b) -> Kleisli m a b

(>>) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a b

return :: a0 -> Kleisli m a a0

MonadPlus m => MonadPlus (Kleisli m a) 
Instance details

Defined in GHC.Internal.Control.Arrow

Methods

mzero :: Kleisli m a a0

mplus :: Kleisli m a a0 -> Kleisli m a a0 -> Kleisli m a a0

Generic (Kleisli m a b) 
Instance details

Defined in GHC.Internal.Control.Arrow

Associated Types

type Rep (Kleisli m a b) 
Instance details

Defined in GHC.Internal.Control.Arrow

type Rep (Kleisli m a b) = D1 ('MetaData "Kleisli" "GHC.Internal.Control.Arrow" "ghc-internal" 'True) (C1 ('MetaCons "Kleisli" 'PrefixI 'True) (S1 ('MetaSel ('Just "runKleisli") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (a -> m b))))

Methods

from :: Kleisli m a b -> Rep (Kleisli m a b) x

to :: Rep (Kleisli m a b) x -> Kleisli m a b

type Rep1 (Kleisli m a :: Type -> Type) 
Instance details

Defined in GHC.Internal.Control.Arrow

type Rep1 (Kleisli m a :: Type -> Type) = D1 ('MetaData "Kleisli" "GHC.Internal.Control.Arrow" "ghc-internal" 'True) (C1 ('MetaCons "Kleisli" 'PrefixI 'True) (S1 ('MetaSel ('Just "runKleisli") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) ((FUN 'Many a :: Type -> Type) :.: Rec1 m)))
type Rep (Kleisli m a b) 
Instance details

Defined in GHC.Internal.Control.Arrow

type Rep (Kleisli m a b) = D1 ('MetaData "Kleisli" "GHC.Internal.Control.Arrow" "ghc-internal" 'True) (C1 ('MetaCons "Kleisli" 'PrefixI 'True) (S1 ('MetaSel ('Just "runKleisli") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (a -> m b))))

type FunctionTable = [(String, String -> String -> Bool)] Source #

Function table type

fctTableString :: FunctionTable Source #

Function table for string tests, XML document value is first operand, schema value second

fctTableList :: FunctionTable Source #

Function table for list tests, XML document value is first operand, schema value second

stringValid :: DatatypeName -> Integer -> Integer -> ParamList -> CheckString Source #

Tests whether a "string" datatype value is between the lower and upper bound of the datatype and matches all parameters.

All tests are performed on the string value.

  • 1.parameter : datatype
  • 2.parameter : lower bound of the datatype range
  • 3.parameter : upper bound of the datatype range (-1 = no upper bound)
  • 4.parameter : list of parameters
  • 5.parameter : datatype value to be checked
  • return : Just "Errormessage" in case of an error, else Nothing

numberValid :: DatatypeName -> Integer -> Integer -> ParamList -> CheckString Source #

Tests whether a "numeric" datatype value is between the lower and upper bound of the datatype and matches all parameters.

First, the string value is parsed into a numeric representation. If no error occur, all following tests are performed on the numeric value.

  • 1.parameter : datatype
  • 2.parameter : lower bound of the datatype range
  • 3.parameter : upper bound of the datatype range (-1 = no upper bound)
  • 4.parameter : list of parameters
  • 5.parameter : datatype value to be checked
  • return : Just "Errormessage" in case of an error, else Nothing

numParamValid :: (Integer -> Integer -> Bool) -> String -> String -> Bool Source #

tests whether a string value matches a numeric param

valid example:

<data type="CHAR"> <param name="maxLength">5</param> </data>

invalid example:

<data type="CHAR"> <param name="minLength">foo</param> </data>

data CheckA a b Source #

Instances

Instances details
Arrow CheckA Source # 
Instance details

Defined in Text.XML.HXT.RelaxNG.DataTypeLibUtils

Methods

arr :: (b -> c) -> CheckA b c #

first :: CheckA b c -> CheckA (b, d) (c, d) #

second :: CheckA b c -> CheckA (d, b) (d, c) #

(***) :: CheckA b c -> CheckA b' c' -> CheckA (b, b') (c, c') #

(&&&) :: CheckA b c -> CheckA b c' -> CheckA b (c, c') #

ArrowPlus CheckA Source # 
Instance details

Defined in Text.XML.HXT.RelaxNG.DataTypeLibUtils

Methods

(<+>) :: CheckA b c -> CheckA b c -> CheckA b c #

ArrowZero CheckA Source # 
Instance details

Defined in Text.XML.HXT.RelaxNG.DataTypeLibUtils

Methods

zeroArrow :: CheckA b c #

Category CheckA Source # 
Instance details

Defined in Text.XML.HXT.RelaxNG.DataTypeLibUtils

Methods

id :: CheckA a a

(.) :: CheckA b c -> CheckA a b -> CheckA a c

type CheckString = CheckA String String Source #

type CheckInteger = CheckA Integer Integer Source #

performCheck :: CheckA a b -> a -> Maybe String Source #

run a check and deliver Just an error message or Nothing

ok :: CheckA a a Source #

every thing is fine

failure :: (a -> String) -> CheckA a b Source #

always failure

assert :: (a -> Bool) -> (a -> String) -> CheckA a a Source #

perform a simple check with a predicate p, when the predicate holds, assert acts as identity, else an error message is generated

assertMaybe :: (a -> Maybe b) -> (a -> String) -> CheckA a b Source #

perform a simple check with a Maybe function, Nothing indicates error

checkWith :: (a -> b) -> CheckA b c -> CheckA a a Source #

perform a check, but convert the value before checking