-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: Sometimes, during a debugging session, we may want to make calls to Slack's API in a ghci repl. It would be useful to be able to call `runBotM :: BotState -> BotM a -> IO a` with little hassle. However, initializing a `BotState` is no easy task. Solution: extract the `BotState` initialization logic into `initBotState`. Now, we can do something like this in the repl: ``` runManaged $ initBotState (Options Nothing) >>= \bs -> liftIO $ runBotM bs $ getUserCached "U036E339XBR" >>= print ```
- Loading branch information
Showing
1 changed file
with
32 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters