| Copyright | (c) 2017 Dominic Orchard Andrew Rice Mistral Contrastin Matthew Danish |
|---|---|
| License | Apache-2.0 |
| Maintainer | dom.orchard@gmail.com |
| Stability | experimental |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Camfort.Specification.Parser
Contents
Description
- data SpecParser e r
- looksLikeASpec :: SpecParser e r -> String -> Bool
- mkParser :: (String -> Either e r) -> [String] -> SpecParser e r
- runParser :: SpecParser e r -> String -> Either (SpecParseError e) r
- data SpecParseError e
- parseError :: e -> SpecParseError e
Specification Parsers
data SpecParser e r Source #
Parser for specifications of type r that may fail with error type e.
looksLikeASpec :: SpecParser e r -> String -> Bool Source #
Check if a comment is probably an attempt at a specification that can be parsed by the given parser.
Arguments
| :: (String -> Either e r) | Parser with error type |
| -> [String] | Keywords that indicate the type of specification. |
| -> SpecParser e r |
Define a specification parser.
runParser :: SpecParser e r -> String -> Either (SpecParseError e) r Source #
Run the given parser on a string to produce a specification (or a reason why it couldn't be parsed).
Errors
data SpecParseError e Source #
Instances
| Eq e => Eq (SpecParseError e) Source # | |
| Show e => Show (SpecParseError e) Source # | |
parseError :: e -> SpecParseError e Source #
Embed an error as a specification parse error.