Copyright | (c) Ewaryst Schulz, DFKI 2009 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | ewaryst.schulz@dfki.de |
Stability | provisional |
Portability | portable |
Safe Haskell | None |
The transformation of the OMDoc intermediate representation to and from xml. The import from xml does not validate the xml, hence if you encounter strange errors, do not forget to check the xml structure first.
- omdoc_current_version :: String
- toQN :: String -> QName
- toQNOM :: String -> QName
- el_omdoc :: QName
- el_oma :: QName
- el_omv :: QName
- el_omatp :: QName
- el_omattr :: QName
- el_ombvar :: QName
- el_oms :: QName
- el_ombind :: QName
- el_omobj :: QName
- el_definition :: QName
- el_text :: QName
- el_notation :: QName
- el_constant :: QName
- el_conass :: QName
- el_component :: QName
- el_open :: QName
- el_selector :: QName
- el_insort :: QName
- el_argument :: QName
- el_constructor :: QName
- el_sortdef :: QName
- el_adt :: QName
- el_type :: QName
- el_structure :: QName
- el_view :: QName
- el_theory :: QName
- at_version :: QName
- at_implicit :: QName
- at_style :: QName
- at_associativity :: QName
- at_index :: QName
- at_fixity :: QName
- at_precedence :: QName
- at_as :: QName
- at_base :: QName
- at_value :: QName
- at_to :: QName
- at_from :: QName
- at_for :: QName
- at_total :: QName
- at_type :: QName
- at_role :: QName
- at_meta :: QName
- at_name :: QName
- at_module :: QName
- attr_om :: Attr
- class XmlRepresentable a where
- xmlOut :: XmlRepresentable a => a -> String
- xmlIn :: XmlParseable a => a -> IO (Result OMDoc)
- listToXml :: XmlRepresentable a => [a] -> [Content]
- listFromXml :: XmlRepresentable a => [Content] -> Result [a]
- mkElement :: QName -> [Attr] -> [Content] -> Content
- makeComment :: String -> Content
- inAContent :: QName -> [Attr] -> Maybe Content -> Content
- inContent :: QName -> Maybe Content -> Content
- toOmobj :: Content -> Content
- urlEscape :: String -> String
- urlUnescape :: String -> String
- showCDName :: OMCD -> OMName -> String
- showCD :: OMCD -> String
- showOMName :: OMName -> String
- readCD :: Show a => a -> String -> OMCD
- readCDName :: String -> OMQualName
- readOMName :: String -> OMName
- tripleEncodeOMS :: OMCD -> OMName -> [Attr]
- pairEncodeCD :: OMCD -> [Attr]
- tripleDecodeOMS :: String -> String -> String -> (OMCD, OMName)
- warnIfNothing :: String -> (Maybe a -> b) -> Maybe a -> Result b
- warnIf :: String -> Bool -> Result ()
- elemIsOf :: Element -> QName -> Bool
- oneOfMsg :: Element -> [QName] -> String
- justReturn :: Monad m => a -> m (Maybe a)
- fmapMaybe :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)
- fmapFromMaybe :: Monad m => (a -> m (Maybe b)) -> Maybe a -> m (Maybe b)
- encapsMaybe :: Monad m => Maybe (m a) -> m (Maybe a)
- flattenMaybe :: Monad m => m (Maybe (Maybe a)) -> m (Maybe a)
- missingMaybe :: String -> String -> Maybe a -> a
- omelementFrom :: QName -> Element -> Result (Maybe OMElement)
- omelementFromOmobj :: Element -> Result (Maybe OMElement)
- omobjToOMElement :: Element -> Result OMElement
- xmlToAssignment :: Element -> Result (OMName, OMImage)
- typeToXml :: OMElement -> Content
- assignmentToXml :: (OMName, OMImage) -> Content
- constantToXml :: String -> String -> OMElement -> Maybe OMElement -> Content
- notationComponentToXml :: NotationComponent -> Content
Names and other constants
omdoc_current_version :: String
The implemented OMDoc version
often used element names
el_notation :: QName
often used element names
el_constant :: QName
often used element names
often used element names
el_selector :: QName
often used element names
el_argument :: QName
often used element names
often used element names
el_sortdef :: QName
often used element names
often used element names
at_version :: QName
at_implicit :: QName
Top level from/to xml functions
class XmlRepresentable a where
This class defines the interface to read from and write to XML
render instance to an XML Element
fromXml :: Element -> Result (Maybe a)
read instance from an XML Element
XmlRepresentable OMElement | OpenMath elements to XML and back |
XmlRepresentable OMAttribute | Helper instance for OpenMath attributes |
XmlRepresentable OmdADT | OMDoc - Algebraic Data Types |
XmlRepresentable TCElement | theory constitutive OMDoc elements to XML and back |
XmlRepresentable TLElement | toplevel OMDoc elements to XML and back |
XmlRepresentable OMDoc | The root instance for representing OMDoc in XML |
xmlOut :: XmlRepresentable a => a -> String
xmlIn :: XmlParseable a => a -> IO (Result OMDoc)
listToXml :: XmlRepresentable a => [a] -> [Content]
listFromXml :: XmlRepresentable a => [Content] -> Result [a]
makeComment :: String -> Content
Encoding/Decoding
urlUnescape :: String -> String
showCDName :: OMCD -> OMName -> String
showOMName :: OMName -> String
readCDName :: String -> OMQualName
readOMName :: String -> OMName
tripleEncodeOMS :: OMCD -> OMName -> [Attr]
pairEncodeCD :: OMCD -> [Attr]
warnIfNothing :: String -> (Maybe a -> b) -> Maybe a -> Result b
Monad and Maybe interaction
justReturn :: Monad m => a -> m (Maybe a)
fmapFromMaybe :: Monad m => (a -> m (Maybe b)) -> Maybe a -> m (Maybe b)
encapsMaybe :: Monad m => Maybe (m a) -> m (Maybe a)
flattenMaybe :: Monad m => m (Maybe (Maybe a)) -> m (Maybe a)
missingMaybe :: String -> String -> Maybe a -> a
Function to extract the Just values from maybes with a default missing error in case of Nothing
fromXml methods
omelementFrom :: QName -> Element -> Result (Maybe OMElement)
If the child element with given name contains an OMOBJ xml element, this is transformed to an OMElement.
omelementFromOmobj :: Element -> Result (Maybe OMElement)
omobjToOMElement :: Element -> Result OMElement
Get an OMElement from an OMOBJ xml element
xmlToAssignment :: Element -> Result (OMName, OMImage)
The input is assumed to be a conass element
toXml methods
assignmentToXml :: (OMName, OMImage) -> Content