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

CalamityCommands.ParsePrefix

Description

Command prefix parsing effect

Synopsis

Documentation

data ParsePrefix msg m a where Source #

An effect for parsing the prefix of a command.

Constructors

ParsePrefix :: msg -> ParsePrefix msg m (Maybe (Text, Text))

Parse a prefix in a message, returning a tuple of (prefix, remaining message)

Instances

Instances details
type DefiningModule (ParsePrefix :: Type -> k -> Type -> Type) Source # 
Instance details

Defined in CalamityCommands.ParsePrefix

type DefiningModule (ParsePrefix :: Type -> k -> Type -> Type) = "CalamityCommands.ParsePrefix"

parsePrefix :: forall msg r. MemberWithError (ParsePrefix msg) r => msg -> Sem r (Maybe (Text, Text)) Source #

useConstantPrefix :: Text -> Sem (ParsePrefix Text ': r) a -> Sem r a Source #

A default interpretation for ParsePrefix that uses a single constant prefix.