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-Inferred |
Language | Haskell2010 |
Synopsis
- 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
.
Instances
Functor (SpecParser e) Source # | |
Defined in Camfort.Specification.Parser fmap :: (a -> b) -> SpecParser e a -> SpecParser e b # (<$) :: a -> SpecParser e b -> SpecParser e a # |
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.
:: (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
parseError :: e -> SpecParseError e Source #
Embed an error as a specification parse error.