calamity-0.1.9.3: A library for writing discord bots
Safe HaskellNone
LanguageHaskell2010

Calamity.Commands.Parser

Description

Something that can parse user input

Synopsis

Documentation

class Typeable a => Parser (a :: Type) r where Source #

Minimal complete definition

parse

Associated Types

type ParserResult a Source #

type ParserResult a = a Source #

Methods

parserName :: Text Source #

default parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult a) Source #

Instances

Instances details
Parser () r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult () Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult ()) Source #

Parser Text r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult Text Source #

Methods

parserName :: Text0 Source #

parse :: Sem (ParserEffs r) (ParserResult Text) Source #

Parser Text r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult Text Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult Text) Source #

Parser Member r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult Member Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult Member) Source #

Member (CacheEff :: (Type -> Type) -> Type -> Type) r => Parser User r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult User Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult User) Source #

Parser a r => Parser [a] r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult [a] Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult [a]) Source #

Parser a r => Parser (Maybe a) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (Maybe a) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (Maybe a)) Source #

(Parser a r, Typeable a) => Parser (NonEmpty a) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (NonEmpty a) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (NonEmpty a)) Source #

Typeable (Snowflake a) => Parser (Snowflake a) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (Snowflake a) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (Snowflake a)) Source #

Parser (Snowflake Channel) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (Snowflake Channel) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (Snowflake Channel)) Source #

Parser (Snowflake Member) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (Snowflake Member) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (Snowflake Member)) Source #

Parser (Snowflake User) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (Snowflake User) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (Snowflake User)) Source #

Parser (Snowflake Role) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (Snowflake Role) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (Snowflake Role)) Source #

Parser (Snowflake Emoji) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (Snowflake Emoji) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (Snowflake Emoji)) Source #

(Monoid (ParserResult a), Parser a r) => Parser (KleeneConcat a) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (KleeneConcat a) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (KleeneConcat a)) Source #

Parser (KleeneConcat Text) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (KleeneConcat Text) Source #

Methods

parserName :: Text0 Source #

parse :: Sem (ParserEffs r) (ParserResult (KleeneConcat Text)) Source #

Parser (KleeneConcat Text) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (KleeneConcat Text) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (KleeneConcat Text)) Source #

(Parser a r, Parser b r) => Parser (a, b) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (a, b) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (a, b)) Source #

(KnownSymbol s, Parser a r) => Parser (Named s a) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (Named s a) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (Named s a)) Source #

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

Instances details
(KnownSymbol s, Parser a r) => Parser (Named s a) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (Named s a) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (Named s a)) Source #

type ParserResult (Named s a) Source # 
Instance details

Defined in Calamity.Commands.Parser

data KleeneConcat (a :: Type) Source #

A parser that consumes zero or more of a then concatenates them together.

KleeneConcat Text Is therefore consumes all remaining input.

Instances

Instances details
(Monoid (ParserResult a), Parser a r) => Parser (KleeneConcat a) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (KleeneConcat a) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (KleeneConcat a)) Source #

Parser (KleeneConcat Text) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (KleeneConcat Text) Source #

Methods

parserName :: Text0 Source #

parse :: Sem (ParserEffs r) (ParserResult (KleeneConcat Text)) Source #

Parser (KleeneConcat Text) r Source # 
Instance details

Defined in Calamity.Commands.Parser

Associated Types

type ParserResult (KleeneConcat Text) Source #

Methods

parserName :: Text Source #

parse :: Sem (ParserEffs r) (ParserResult (KleeneConcat Text)) Source #

type ParserResult (KleeneConcat a) Source # 
Instance details

Defined in Calamity.Commands.Parser

type ParserResult (KleeneConcat Text) Source # 
Instance details

Defined in Calamity.Commands.Parser

type ParserResult (KleeneConcat Text) Source # 
Instance details

Defined in Calamity.Commands.Parser

runCommandParser :: Context -> Text -> Sem (ParserEffs r) a -> Sem r (Either (Text, Text) a) Source #