Hets - the Heterogeneous Tool Set

Copyright(c) Ewaryst Schulz, DFKI 2009
LicenseGPLv2 or higher, see LICENSE.txt
Maintainerewaryst.schulz@dfki.de
Stabilityprovisional
Portabilityportable
Safe HaskellNone

OMDoc.XmlInterface

Contents

Description

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.

Synopsis

Names and other constants

omdoc_current_version :: String

The implemented OMDoc version

el_omdoc :: QName

often used element names

el_oma :: QName

often used element names

el_omv :: QName

often used element names

el_omatp :: QName

often used element names

el_omattr :: QName

often used element names

el_ombvar :: QName

often used element names

el_oms :: QName

often used element names

el_ombind :: QName

often used element names

el_omobj :: QName

often used element names

el_definition :: QName

often used element names

el_text :: QName

often used element names

el_notation :: QName

often used element names

el_constant :: QName

often used element names

el_conass :: QName

often used element names

el_component :: QName

often used element names

el_open :: QName

often used element names

el_selector :: QName

often used element names

el_insort :: QName

often used element names

el_argument :: QName

often used element names

el_constructor :: QName

often used element names

el_sortdef :: QName

often used element names

el_adt :: QName

often used element names

el_type :: QName

often used element names

el_structure :: QName

often used element names

el_view :: QName

often used element names

el_theory :: QName

often used element names

Top level from/to xml functions

class XmlRepresentable a where

This class defines the interface to read from and write to XML

Methods

toXml :: a -> Content

render instance to an XML Element

fromXml :: Element -> Result (Maybe a)

read instance from an XML Element

Instances

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

Encoding/Decoding

readCD :: Show a => a -> String -> OMCD

warnIfNothing :: String -> (Maybe a -> b) -> Maybe a -> Result b

warnIf :: String -> Bool -> Result ()

Monad and Maybe interaction

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

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.

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