haskell-ro / hs-dicebot

IRC bot that handles dice rolling for tabletop-like RPGs
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Refactor using State/Reader monad #9

Closed spyked closed 11 years ago

spyked commented 11 years ago

DiceBot is inspired mainly from the Roll your own IRC bot Haskell tutorial, which uses a Reader monad for implicit parameters such as the server handle (there might be others in the case of the DiceBot).

8 (and most probably other enhancements) would be much easier to implement if a the code were better organized, and the Reader monad seems well-suited for the task. Keep in mind, though, that the bot might have to maintain state in the future (see #3), so the State monad might (also) be a better long-term choice (or maybe a monad stack based on Reader, Writer and IO).