calamity-commands-0.1.0.0: A library for declaring, parsing, and invoking text-input based commands
Safe HaskellNone
LanguageHaskell2010

CalamityCommands.Command

Description

Commands and stuff

Synopsis

Documentation

data Command (m :: Type -> Type) (c :: Type) (a :: Type) Source #

A command, paremeterised over it's context

Constructors

forall p. Command 

Fields

  • names :: NonEmpty Text
     
  • parent :: Maybe (Group m c a)
     
  • hidden :: Bool

    If this command is hidden

  • checks :: [Check m c]

    A list of checks that must pass for this command to be invoked

  • params :: [Text]

    A list of the parameters the command takes, only used for constructing help messages.

  • help :: c -> Text

    A function producing the 'help' for the command.

  • parser :: c -> m (Either CommandError p)

    A function that parses the context for the command, producing the input a for the command.

  • callback :: (c, p) -> m (Either Text a)

    A function that given the context and the input (p) of the command, performs the action of the command.

Instances

Instances details
Show (Command m c a) Source # 
Instance details

Defined in CalamityCommands.Command

Methods

showsPrec :: Int -> Command m c a -> ShowS #

show :: Command m c a -> String #

showList :: [Command m c a] -> ShowS #

TextShow (Command m c a) Source # 
Instance details

Defined in CalamityCommands.Command

Methods

showbPrec :: Int -> Command m c a -> Builder

showb :: Command m c a -> Builder

showbList :: [Command m c a] -> Builder

showtPrec :: Int -> Command m c a -> Text

showt :: Command m c a -> Text

showtList :: [Command m c a] -> Text

showtlPrec :: Int -> Command m c a -> Text

showtl :: Command m c a -> Text

showtlList :: [Command m c a] -> Text