Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Uses parsec to parse definition lines.
Synopsis
- parseDefinitions :: String -> [Definition]
- parseDefinitions' :: Parser [Definition]
- parseDef :: Parser Definition
- eol :: Parser Char
- parseDefLine :: Parser Definition
- parseUnitDef :: Parser Definition
- parseSynonym :: Parser Symbol
- parseBaseLine :: Parser Definition
- parseBase :: Parser (Symbol, Symbol)
- parsePrefixLine :: Parser Definition
- parsePrefix :: Parser (Symbol, Double)
- parsePrefixSynonym :: Parser Symbol
- parseSymbol :: Parser Symbol
Documentation
parseDefinitions :: String -> [Definition] Source #
Parse multiline string of definitions (say, from a file) into a list of definitions.
parseDefinitions' :: Parser [Definition] Source #
Parsec parser for definitions.
parseDef :: Parser Definition Source #
Parse any definition line
parseDefLine :: Parser Definition Source #
Parse a line containing unit definition Ex: minute = 60 s = min
parseUnitDef :: Parser Definition Source #
Parses a unit definition. Example: foot = 12 in = ft = feet
parseSynonym :: Parser Symbol Source #
Parses the synonyms at the end of a base or unit definition.
parseBaseLine :: Parser Definition Source #
Parse line containing base definition. Ex: meter = [length] = m
parseBase :: Parser (Symbol, Symbol) Source #
Parse the base of a base definition. Example: [length] -> length
parsePrefixLine :: Parser Definition Source #
Parse line containing prefix definition Ex: milli- = 1e-3 = m-
parsePrefix :: Parser (Symbol, Double) Source #
Parse the prefix part of a prefix definition. Example: yocto- -> yocto
parsePrefixSynonym :: Parser Symbol Source #
Parse the synonyms for a prefix definition.
parseSymbol :: Parser Symbol Source #
Parse a symbol for a unit