gimlh-0.1.1.0: Haskell parser for GIML

PortabilityPOSIX
Stabilityexperimental
Maintaineralex.gaziev@gmail.com
Safe HaskellSafe-Inferred

Gimlh

Contents

Description

Haskell parser for GIML.

Synopsis

Data types

type Giml = [GimlNode]Source

Type Giml represent list of GimlNodes

data GimlVal Source

Value represent parsed data for specified variable name

Constructors

Text String

Text value

List [String]

List value

Number Integer

Integer number value

Float Double

Float number value

Instances

data GimlType Source

Type of value for internal functions

Constructors

TextG

Type for text value, stored in GimlNode

ListG

Type for list value, stored in GimlNode

NumberG

Type for integer number value, stored in GimlNode

FloatG

Type for float number value, stored in GimlNode

Instances

type GimlNode = (String, GimlType, GimlVal)Source

Type GimlNode represent list of tuples. Tuple contains String as key, GimlType as type of value and GimlVal as value

type SimpleGiml = [(String, GimlVal)]Source

Type SimpleGiml represent list of tuples. Tuple contains String as key and GimlVal as value

Functions for parse and modify GIML

parseString :: String -> GimlSource

The parseString method will parse GIML from pure string.

parseFile :: FilePath -> IO GimlSource

The parseFile method will parse GIML from file by FilePath

simplifyGiml :: Giml -> SimpleGimlSource

The simplifyGiml method will remove types from Giml creating SimpleGiml object

fetch :: SimpleGiml -> String -> Maybe GimlValSource

The fetch method will fetch values from simplified giml by given key

fetchG :: Giml -> String -> Maybe GimlValSource

The fetchG method will fetch values from giml by given key

val2Str :: GimlVal -> StringSource

The val2Str method will retrun values stored in GIML in string representation

val2List :: GimlVal -> [String]Source

The val2List method will retrun values stored in GIML in list of string representation