Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
CalamityCommands.ParsePrefix
Description
Command prefix parsing effect
Synopsis
- data ParsePrefix msg m a where
- ParsePrefix :: msg -> ParsePrefix msg m (Maybe (Text, Text))
- parsePrefix :: forall msg r. Member (ParsePrefix msg) r => msg -> Sem r (Maybe (Text, Text))
- useConstantPrefix :: Text -> Sem (ParsePrefix Text ': r) a -> Sem r a
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 |
parsePrefix :: forall msg r. Member (ParsePrefix msg) r => msg -> Sem r (Maybe (Text, Text)) Source #
Parse a prefix in a message, returning a tuple of (prefix, remaining message)
useConstantPrefix :: Text -> Sem (ParsePrefix Text ': r) a -> Sem r a Source #
A default interpretation for ParsePrefix
that uses a single constant prefix.