Skip to content

Commit aebba52

Browse files
committed
Add withEffect helper in Telegram.Bot.Simple.Eff
1 parent ecc21cd commit aebba52

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Telegram/Bot/Simple/Eff.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ runEff = runWriter . _runEff
3838
eff :: BotM a -> Eff a ()
3939
eff e = Eff (tell [e])
4040

41+
withEffect :: BotM action -> model -> Eff action model
42+
withEffect effect model = eff effect >> pure model
43+
4144
(<#) :: model -> BotM action -> Eff action model
42-
m <# a = eff a >> pure m
45+
(<#) = flip withEffect
4346

4447
-- | Set a specific 'Telegram.Update' in a 'BotM' context.
4548
setBotMUpdate :: Maybe Telegram.Update -> BotM a -> BotM a

0 commit comments

Comments
 (0)