Copyright | 2012 Kei Hibino, 2010-11 University of Marburg |
---|---|
License | BSD3 |
Maintainer | ex8k.hibino@gmail.com |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell98 |
This module contains type classes for invertible syntax.
- class ProductFunctor f where
- (<*>) :: f alpha -> f beta -> f (alpha, beta)
- class IsoAlternative f where
- class IsoAlternative f => TryAlternative f where
- class (IsoFunctor delta, ProductFunctor delta, IsoAlternative delta, TryAlternative delta) => AbstractSyntax delta where
- syntax :: Eq alpha => alpha -> delta alpha
- syntaxError :: String -> delta alpha
- class AbstractSyntax delta => Syntax tok delta | delta -> tok where
- token :: delta tok
Documentation
class ProductFunctor f where Source
Apply IsoFunctor
to another argument with uncurried style.
ProductFunctor (Printer tok) Source |
|
class IsoAlternative f where Source
Monoid class for IsoFunctor
(<||>) :: f alpha -> f alpha -> f alpha infixr 3 Source
like MonadPlus (mplus) or Alternative ((<|>))
IsoAlternative (Printer tok) Source |
|
class IsoAlternative f => TryAlternative f where Source
Support try for combinators which semantics is like Parsec
Nothing
try :: f alpha -> f alpha Source
This method should be implemented for combinators
which semantics is not full-backtracking like parsec.
ex. try = Text.Parsec.try
TryAlternative (Printer tok) Source |
|
TryAlternative (Parser tok) Source | |
TryAlternative (Parser tok) Source | |
TryAlternative (Parser tok) Source | |
TryAlternative (Parser tok) Source | |
TryAlternative (Parser tok) Source |
class (IsoFunctor delta, ProductFunctor delta, IsoAlternative delta, TryAlternative delta) => AbstractSyntax delta where Source
Syntax abstraction.
syntax :: Eq alpha => alpha -> delta alpha Source
Lift a value.
syntaxError :: String -> delta alpha Source
AbstractSyntax (Printer tok) Source |
|
class AbstractSyntax delta => Syntax tok delta | delta -> tok where Source
Syntax abstraction with token type tok
.