Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
AST for gml (Graph Modelling Language) files. The specification of the gml format can be found at: http://www.fim.uni-passau.de/fileadmin/files/lehrstuhl/brandenburg/projekte/gml/gml-technical-report.pdf.
Synopsis
- data Gml k
- lookupValue :: Eq k => Gml k -> k -> Maybe (Gml k)
- integerValue :: Gml k -> Maybe Integer
- floatValue :: Gml k -> Maybe Double
- stringValue :: Gml k -> Maybe k
- objectValues :: Gml k -> Maybe [(k, Gml k)]
- mapStrings :: (a -> b) -> Gml a -> Gml b
Documentation
Type of a AST node.
k
is the type that is used to represent strings.
Integer Integer | Integer value |
Float Double | Floating point value |
String k | String value |
Object [(k, Gml k)] | Object value. A gml object is a list of named values. The names of the values are not necessarily unique! |
lookupValue :: Eq k => Gml k -> k -> Maybe (Gml k) Source #
Looks up a value in the given gml object.
Produces Nothing
when the given value is not a gml object or the object
doesn't contain the a value with the given name. If a object contains
multiple values with the same name one the values is returned.
integerValue :: Gml k -> Maybe Integer Source #
If the given gml value is a integer produces the integer value.
floatValue :: Gml k -> Maybe Double Source #
If the given gml value is a double value produces the float value.
stringValue :: Gml k -> Maybe k Source #
If the given gml value is a string produces the string value.
objectValues :: Gml k -> Maybe [(k, Gml k)] Source #
If the given gml value is an object produces the list of values that the object contains.
mapStrings :: (a -> b) -> Gml a -> Gml b Source #
Maps all strings in the gml ast.