module Text.Grampa (
MultiParsing(..),
simply,
Grammar, GrammarBuilder, ParseResults, ParseFailure(..),
GrammarParsing(..), MonoidParsing(..),
module Text.Parser.Char,
module Text.Parser.Combinators,
module Text.Parser.LookAhead)
where
import Text.Parser.Char (CharParsing(char, notChar, anyChar))
import Text.Parser.Combinators (Parsing((<?>), notFollowedBy, skipMany, skipSome, unexpected))
import Text.Parser.LookAhead (LookAheadParsing(lookAhead))
import Data.Functor.Compose (Compose(..))
import qualified Rank2
import Text.Grampa.Class (MultiParsing(..), GrammarParsing(..), MonoidParsing(..), ParseResults, ParseFailure(..))
type Grammar (g :: (* -> *) -> *) p s = g (p g s)
type GrammarBuilder (g :: (* -> *) -> *)
(g' :: (* -> *) -> *)
(p :: ((* -> *) -> *) -> * -> * -> *)
(s :: *)
= g (p g' s) -> g (p g' s)
simply :: (Rank2.Only r (p (Rank2.Only r) s) -> s -> Rank2.Only r f)
-> p (Rank2.Only r) s r -> s -> f r
simply parseGrammar p input = Rank2.fromOnly (parseGrammar (Rank2.Only p) input)