Safe Haskell | None |
---|---|
Language | Haskell2010 |
Something that can parse user input
Synopsis
- class Typeable a => Parser (a :: Type) r where
- type ParserResult a
- parserName :: Text
- parse :: Sem (ParserEffs r) (ParserResult a)
- data Named (s :: Symbol) (a :: Type)
- data KleeneConcat (a :: Type)
- runCommandParser :: Context -> Text -> Sem (ParserEffs r) a -> Sem r (Either (Text, Text) a)
Documentation
class Typeable a => Parser (a :: Type) r where Source #
type ParserResult a Source #
type ParserResult a = a Source #
parserName :: Text Source #
default parserName :: Text Source #
parse :: Sem (ParserEffs r) (ParserResult a) Source #
Instances
data Named (s :: Symbol) (a :: Type) Source #
A named parameter, used to attach the name s
to a type in the command's
help output
Instances
(KnownSymbol s, Parser a r) => Parser (Named s a) r Source # | |
Defined in Calamity.Commands.Parser type ParserResult (Named s a) Source # parserName :: Text Source # parse :: Sem (ParserEffs r) (ParserResult (Named s a)) Source # | |
type ParserResult (Named s a) Source # | |
Defined in Calamity.Commands.Parser |
data KleeneConcat (a :: Type) Source #
A parser that consumes zero or more of a
then concatenates them together.
Is therefore consumes all remaining input.KleeneConcat
Text
Instances
(Monoid (ParserResult a), Parser a r) => Parser (KleeneConcat a) r Source # | |
Defined in Calamity.Commands.Parser type ParserResult (KleeneConcat a) Source # parserName :: Text Source # parse :: Sem (ParserEffs r) (ParserResult (KleeneConcat a)) Source # | |
Parser (KleeneConcat Text) r Source # | |
Defined in Calamity.Commands.Parser type ParserResult (KleeneConcat Text) Source # parserName :: Text0 Source # parse :: Sem (ParserEffs r) (ParserResult (KleeneConcat Text)) Source # | |
Parser (KleeneConcat Text) r Source # | |
Defined in Calamity.Commands.Parser type ParserResult (KleeneConcat Text) Source # parserName :: Text Source # parse :: Sem (ParserEffs r) (ParserResult (KleeneConcat Text)) Source # | |
type ParserResult (KleeneConcat a) Source # | |
Defined in Calamity.Commands.Parser | |
type ParserResult (KleeneConcat Text) Source # | |
Defined in Calamity.Commands.Parser | |
type ParserResult (KleeneConcat Text) Source # | |
Defined in Calamity.Commands.Parser |