telegram-bot-simple-0.2.0: Easy to use library for building Telegram bots.

Safe HaskellNone
LanguageHaskell2010

Telegram.Bot.Simple.Eff

Synopsis

Documentation

newtype BotM a #

Bot handler context.

The context may include an Update the bot is handling at the moment.

Constructors

BotM 
Instances
Monad BotM # 
Instance details

Defined in Telegram.Bot.Simple.Eff

Methods

(>>=) :: BotM a -> (a -> BotM b) -> BotM b #

(>>) :: BotM a -> BotM b -> BotM b #

return :: a -> BotM a #

fail :: String -> BotM a #

Functor BotM # 
Instance details

Defined in Telegram.Bot.Simple.Eff

Methods

fmap :: (a -> b) -> BotM a -> BotM b #

(<$) :: a -> BotM b -> BotM a #

Applicative BotM # 
Instance details

Defined in Telegram.Bot.Simple.Eff

Methods

pure :: a -> BotM a #

(<*>) :: BotM (a -> b) -> BotM a -> BotM b #

liftA2 :: (a -> b -> c) -> BotM a -> BotM b -> BotM c #

(*>) :: BotM a -> BotM b -> BotM b #

(<*) :: BotM a -> BotM b -> BotM a #

MonadIO BotM # 
Instance details

Defined in Telegram.Bot.Simple.Eff

Methods

liftIO :: IO a -> BotM a #

MonadReader BotContext BotM # 
Instance details

Defined in Telegram.Bot.Simple.Eff

Methods

ask :: BotM BotContext #

local :: (BotContext -> BotContext) -> BotM a -> BotM a #

reader :: (BotContext -> a) -> BotM a #

data BotContext #

Instances
MonadReader BotContext BotM # 
Instance details

Defined in Telegram.Bot.Simple.Eff

Methods

ask :: BotM BotContext #

local :: (BotContext -> BotContext) -> BotM a -> BotM a #

reader :: (BotContext -> a) -> BotM a #

newtype Eff action model #

Constructors

Eff 

Fields

Instances
Bifunctor Eff # 
Instance details

Defined in Telegram.Bot.Simple.Eff

Methods

bimap :: (a -> b) -> (c -> d) -> Eff a c -> Eff b d #

first :: (a -> b) -> Eff a c -> Eff b c #

second :: (b -> c) -> Eff a b -> Eff a c #

Monad (Eff action) # 
Instance details

Defined in Telegram.Bot.Simple.Eff

Methods

(>>=) :: Eff action a -> (a -> Eff action b) -> Eff action b #

(>>) :: Eff action a -> Eff action b -> Eff action b #

return :: a -> Eff action a #

fail :: String -> Eff action a #

Functor (Eff action) # 
Instance details

Defined in Telegram.Bot.Simple.Eff

Methods

fmap :: (a -> b) -> Eff action a -> Eff action b #

(<$) :: a -> Eff action b -> Eff action a #

Applicative (Eff action) # 
Instance details

Defined in Telegram.Bot.Simple.Eff

Methods

pure :: a -> Eff action a #

(<*>) :: Eff action (a -> b) -> Eff action a -> Eff action b #

liftA2 :: (a -> b -> c) -> Eff action a -> Eff action b -> Eff action c #

(*>) :: Eff action a -> Eff action b -> Eff action b #

(<*) :: Eff action a -> Eff action b -> Eff action a #

runEff :: Eff action model -> (model, [BotM action]) #

eff :: BotM a -> Eff a () #

withEffect :: BotM action -> model -> Eff action model #

(<#) :: model -> BotM action -> Eff action model #

setBotMUpdate :: Maybe Update -> BotM a -> BotM a #

Set a specific Update in a BotM context.

setEffUpdate :: Maybe Update -> Eff action model -> Eff action model #

Set a specific Update in every effect of Eff context.