| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Program.Mighty.Parser
Description
Parsers for Mighty
Utilities
parseFile :: Parser a -> FilePath -> IO a Source
Parsing a file.
If parsing fails, an IOException is thrown.
Parsers
Parser to consume zero or more white spaces
>>>parse spcs "" " "Right ()>>>parse spcs "" ""Right ()
Parser to consume one or more white spaces
>>>parse spcs1 "" " "Right ()>>>parse spcs1 "" " "Right ()>>>isLeft $ parse spcs1 "" ""True
Parser to consume exactly one white space
>>>parse spc "" " "Right ' '>>>isLeft $ parse spc "" ""True
commentLines :: Parser () Source
Parser to consume one or more comment lines
>>>parse commentLines "" "# comments\n# comments\n# comments\n"Right ()
Parser to consume a trailing comment
>>>parse trailing "" "# comments\n"Right ()>>>isLeft $ parse trailing "" "X# comments\n"True