Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
failAction :: ActionTask ctx a #
modifyAction :: (ctx -> ctx) -> ActionTask ctx () #
getAction :: ActionTask ctx ctx #
newtype ActionTask ctx a #
ActionTask | |
|
Instances
Monad (ActionTask ctx) | |
Defined in Language.Parser.Ptera.Syntax (>>=) :: ActionTask ctx a -> (a -> ActionTask ctx b) -> ActionTask ctx b # (>>) :: ActionTask ctx a -> ActionTask ctx b -> ActionTask ctx b # return :: a -> ActionTask ctx a # | |
Functor (ActionTask ctx) | |
Defined in Language.Parser.Ptera.Syntax fmap :: (a -> b) -> ActionTask ctx a -> ActionTask ctx b # (<$) :: a -> ActionTask ctx b -> ActionTask ctx a # | |
Applicative (ActionTask ctx) | |
Defined in Language.Parser.Ptera.Syntax pure :: a -> ActionTask ctx a # (<*>) :: ActionTask ctx (a -> b) -> ActionTask ctx a -> ActionTask ctx b # liftA2 :: (a -> b -> c) -> ActionTask ctx a -> ActionTask ctx b -> ActionTask ctx c # (*>) :: ActionTask ctx a -> ActionTask ctx b -> ActionTask ctx b # (<*) :: ActionTask ctx a -> ActionTask ctx b -> ActionTask ctx a # |
data ActionTaskResult ctx a #
Instances
Functor (ActionTaskResult ctx) | |
Defined in Language.Parser.Ptera.Syntax fmap :: (a -> b) -> ActionTaskResult ctx a -> ActionTaskResult ctx b # (<$) :: a -> ActionTaskResult ctx b -> ActionTaskResult ctx a # | |
(Eq a, Eq ctx) => Eq (ActionTaskResult ctx a) | |
Defined in Language.Parser.Ptera.Syntax (==) :: ActionTaskResult ctx a -> ActionTaskResult ctx a -> Bool # (/=) :: ActionTaskResult ctx a -> ActionTaskResult ctx a -> Bool # | |
(Show a, Show ctx) => Show (ActionTaskResult ctx a) | |
Defined in Language.Parser.Ptera.Syntax showsPrec :: Int -> ActionTaskResult ctx a -> ShowS # show :: ActionTaskResult ctx a -> String # showList :: [ActionTaskResult ctx a] -> ShowS # |
ruleExpr :: forall (action :: [Type] -> Type -> Type) rules tokens elem a. [Alt action rules tokens elem a] -> RuleExpr action rules tokens elem a #
fixGrammar :: forall (initials :: [Symbol]) (action :: [Type] -> Type -> Type) rules tokens elem. (MemberInitials rules initials, Rules rules, RuleExprType rules ~ RuleExpr action rules tokens elem) => rules -> Grammar action rules tokens elem initials #
type family RuleExprType rules :: Type -> Type #
class GrammarToken tokens elem where #
tokenToTerminal :: Proxy tokens -> elem -> T (TokensTag tokens) #
type family RuleExprReturnType rules (v :: Symbol) #
class KnownSymbol v => HasRuleExprField rules (v :: Symbol) where #
type RuleExprReturnType rules (v :: Symbol) #
getExprField :: rules -> proxy v -> RuleExprType rules (RuleExprReturnType rules v) #
nonTerminalName :: rules -> proxy v -> String #
class MemberInitials rules (initials :: [Symbol]) where #
memberInitials :: T (DictF (HasRuleExprField rules)) initials #
generateRules :: T (DictF (HasRuleExprField rules)) (RulesTag rules) #
class TokensMember tokens (t :: Symbol) where #
tokensMembership :: Proxy# '(tokens, t) -> Membership (TokensTag tokens) t #
data DictF (a :: k -> Constraint) (b :: k) where #
DictF :: forall k (a :: k -> Constraint) (b :: k). a b => DictF a b |
(<^>) :: TypedExpr rules tokens elem us1 -> TypedExpr rules tokens elem us2 -> TypedExpr rules tokens elem (Concat us1 us2) infixr 5 Source #
(<:>) :: T ctx => T a => TypedExpr rules tokens elem us -> (HTExpList us -> Q (TExp a)) -> AltM ctx rules tokens elem a infixl 4 Source #
(<::>) :: T ctx => T a => TypedExpr rules tokens elem us -> (HTExpList us -> Q (TExp (ActionTask ctx a))) -> AltM ctx rules tokens elem a infixl 4 Source #
var :: forall v rules tokens elem proxy1 proxy2 a. KnownSymbol v => a ~ RuleExprReturnType rules v => T a => proxy1 rules -> proxy2 v -> TypedExpr rules tokens elem '[a] Source #
varA :: forall v rules tokens elem a. KnownSymbol v => a ~ RuleExprReturnType rules v => T a => TypedExpr rules tokens elem '[a] Source #
tok :: forall t rules tokens elem proxy. T elem => proxy elem -> Membership (TokensTag tokens) t -> TypedExpr rules tokens elem '[elem] Source #
tokA :: forall t rules tokens elem. T elem => TokensMember tokens t => TypedExpr rules tokens elem '[elem] Source #
runListScanner :: ListScanner e a -> [e] -> a #
class Monad m => Scanner posMark elem (m :: Type -> Type) | m -> posMark, m -> elem where #
Instances
Scanner [e] e (ListScanner e) | |
Defined in Language.Parser.Ptera.Scanner consumeInput :: ListScanner e (Maybe e) # getPosMark :: ListScanner e [e] # seekToPosMark :: [e] -> ListScanner e () # scanMode :: ScanMode [e] -> ListScanner e () # |
ScanModeNoBack | |
ScanModeNeedBack posMark |
newtype ListScanner e a #
ListScanner | |
|
Instances
runParser :: forall (v :: Symbol) (initials :: [Symbol]) posMark m rules elem proxy. (Member initials v, T posMark elem m) => proxy v -> Runner rules elem initials -> m (Result posMark (RuleExprReturnType rules v)) #
runParserM :: forall (v :: Symbol) (initials :: [Symbol]) ctx posMark m rules elem proxy. (Member initials v, T posMark elem m) => proxy v -> RunnerM ctx rules elem initials -> ctx -> m (Result posMark (RuleExprReturnType rules v)) #
type Result posMark = ParseResult posMark () #
data ParseResult posMark altHelp a #
Parsed a | |
ParseFailed posMark (FailedReason altHelp) |
Instances
Functor (ParseResult posMark altHelp) | |
Defined in Language.Parser.Ptera.Runner.RunT fmap :: (a -> b) -> ParseResult posMark altHelp a -> ParseResult posMark altHelp b # (<$) :: a -> ParseResult posMark altHelp b -> ParseResult posMark altHelp a # | |
(Show a, Show posMark, Show altHelp) => Show (ParseResult posMark altHelp a) | |
Defined in Language.Parser.Ptera.Runner.RunT showsPrec :: Int -> ParseResult posMark altHelp a -> ShowS # show :: ParseResult posMark altHelp a -> String # showList :: [ParseResult posMark altHelp a] -> ShowS # |
data GenRulesTypes Source #
GenRulesTypes | |
|
class LiftType a where Source #
Instances
LiftType Char Source # | |
LiftType Int Source # | |
LiftType Integer Source # | |
LiftType () Source # | |
LiftType a => LiftType ([a] :: Type) Source # | |
LiftType a => LiftType (Maybe a :: Type) Source # | |
LiftType a => LiftType (Ratio a :: Type) Source # | |
LiftType a => LiftType (Seq a :: Type) Source # | |
(LiftType a, LiftType b) => LiftType ((a, b) :: Type) Source # | |
(LiftType a, LiftType b, LiftType c) => LiftType ((a, b, c) :: Type) Source # | |
genRunner :: forall initials rules tokens ctx elem. GrammarToken tokens elem => Generate (TokensTag tokens) => GenParam -> GrammarM ctx rules tokens elem initials -> Q [Dec] Source #