| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Calamity.Commands.Parser
Description
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 KleeneStarConcat (a :: Type)
- data KleenePlusConcat (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 #
Minimal complete definition
Methods
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 Associated Types type ParserResult (Named s a) Source # | |
| type ParserResult (Named s a) Source # | |
Defined in Calamity.Commands.Parser | |
data KleeneStarConcat (a :: Type) Source #
A parser that consumes zero or more of a then concatenates them together.
Is therefore consumes all remaining input.KleeneStarConcat Text
Instances
data KleenePlusConcat (a :: Type) Source #
A parser that consumes one or more of a then concatenates them together.
Is therefore consumes all remaining input.KleenePlusConcat Text