Copyright | 2012 Kei Hibino |
---|---|
License | BSD3 |
Maintainer | ex8k.hibino@gmail.com |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell98 |
This module contains handy Rank2 type synonyms which has Syntax
contexts.
- type SyntaxT tok a = forall delta. Syntax tok delta => delta a
- type RunAsParser tok tks a e = SyntaxT tok a -> tks -> Either e a
- type RunAsParserM m tok tks a e = SyntaxT tok a -> tks -> m (Either e a)
- type RunAsPrinter tok tks a e = SyntaxT tok a -> a -> Either e tks
- type RunAsPrinterM m tok tks a e = SyntaxT tok a -> a -> m (Either e tks)
- data ErrorString
- errorString :: String -> ErrorString
Syntax type
type SyntaxT tok a = forall delta. Syntax tok delta => delta a Source
Type synonym for Syntax
includes contexts. Rank2Types extension is needed.
Type to run syntax as Parser / Printer.
type RunAsParser tok tks a e = SyntaxT tok a -> tks -> Either e a Source
Type to run syntax as parser
type RunAsParserM m tok tks a e = SyntaxT tok a -> tks -> m (Either e a) Source
Same as RunAsParser
other than with computation m
type RunAsPrinter tok tks a e = SyntaxT tok a -> a -> Either e tks Source
Type to run syntax as printer
type RunAsPrinterM m tok tks a e = SyntaxT tok a -> a -> m (Either e tks) Source
Same as RunAsPrinter
other than with computation m
Error string type
data ErrorString Source
String type which is Show
instance not to show but just return String
errorString :: String -> ErrorString Source
Construct ErrorString