HaXml-1.25.14: Utilities for manipulating XML documents

Safe Haskell | Safe-Inferred
Language | Haskell98

Text.XML.HaXml.Schema.TypeConversion

Contents

- Orphan instances

Synopsis

- singleton :: a -> [a]
- comment :: Annotation -> Comment
- typeLift :: Schema -> Schema
- convert :: Environment -> Schema -> [Decl]
- xname :: String -> XName
- mkRestrict :: Restriction -> [Restrict]
- repeatedly :: (a -> Maybe a) -> a -> [a]
- supertypeOf :: Environment -> QName -> Maybe QName
- checkXName :: Schema -> QName -> XName
- occursToModifier :: Occurs -> Modifier
- nameOfSimple :: SimpleType -> XName
- combineOccursModifier :: Occurs -> Modifier -> Modifier
- consolidate :: Occurs -> (FacetType, Annotation, String) -> Occurs

# Documentation

singleton :: a -> [a] Source #

comment :: Annotation -> Comment Source #

typeLift :: Schema -> Schema Source #

Transform a Schema by lifting all locally-defined anonymous types to the top-level, naming them, and planting a referend at their original location.

convert :: Environment -> Schema -> [Decl] Source #

Given an environment of schema type mappings, and a schema module, create a bunch of Decls that describe the types in a more Haskell-friendly way.

xname :: String -> XName Source #

mkRestrict :: Restriction -> [Restrict] Source #

repeatedly :: (a -> Maybe a) -> a -> [a] Source #

Keep applying the function to transform the value, until it yields Nothing. Returns the sequence of transformed values.

supertypeOf :: Environment -> QName -> Maybe QName Source #

Find the supertype (if it exists) of a given type name.

checkXName :: Schema -> QName -> XName Source #

occursToModifier :: Occurs -> Modifier Source #

Convert an occurs range to a Haskell-style type modifier (Maybe, List, Id)

nameOfSimple :: SimpleType -> XName Source #

combineOccursModifier :: Occurs -> Modifier -> Modifier Source #

Push another Occurs value inside an existing Modifier.

consolidate :: Occurs -> (FacetType, Annotation, String) -> Occurs Source #

Consolidate a Facet occurrence into a single Occurs value.

# Orphan instances

Monoid Occurs Source # |
Instance details Methods mempty :: Occurs Source # mappend :: Occurs -> Occurs -> Occurs Source # mconcat :: [Occurs] -> Occurs Source #
Semigroup Occurs Source # |
Instance details Methods (<>) :: Occurs -> Occurs -> Occurs Source # sconcat :: NonEmpty Occurs -> Occurs Source # stimes :: Integral b => b -> Occurs -> Occurs Source #