Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class GFromCommand command where
- gGetMessage :: command proxy -> Msg
- gGetPrefix :: command proxy -> Text
- class FromCommand command where
- getMessage :: command -> Msg
- getPrefix :: command -> Text
- fromCommand :: FromCommand command => command -> Msg
- toKebabCase :: Text -> Text
- data MaybeWith (modifier :: Modifier) a = MaybeWith a
- data Modifier = AtEnd Symbol
Documentation
class GFromCommand command where Source #
Helper type class used to derive FromCommand
via DeriveGeneric extension.
gGetMessage :: command proxy -> Msg Source #
gGetPrefix :: command proxy -> Text Source #
Instances
class FromCommand command where Source #
Nothing
getMessage :: command -> Msg Source #
default getMessage :: (Generic command, GFromCommand (Rep command)) => command -> Msg Source #
Instances
fromCommand :: FromCommand command => command -> Msg Source #
Transform incoming telegram command into Msg
.
Helpers
toKebabCase :: Text -> Text Source #
Helper to transform text into kebab case.
data MaybeWith (modifier :: Modifier) a Source #
Instances
(KnownSymbol postfix, FromCommand a, modifier ~ 'AtEnd postfix) => FromCommand (MaybeWith modifier a) Source # | |