josuf107 / xioqbot

twitch queue bot
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Cleanup Queue module #31

Closed josuf107 closed 7 years ago

josuf107 commented 7 years ago

The Queue module currently is at 685 lines and contains a lot of duplicate code, and some generic utilities etc. It would be good to split the utilities out of the Queue module, reduce the code duplication between the command handlers, and possibly split the command handlers into a separate module. It's starting to get a teensy bit painful to make changes in here.

josuf107 commented 7 years ago

I went ahead and added -Wall to the ghc flags so now it's like legit code.

josuf107 commented 7 years ago

I split Command into Command and CommandParser and I split Queue into Queue and CommandHandler. Noice.

josuf107 commented 7 years ago

Okay I also split out a new module Messages from CommandHandler to separate all the reply construction from the queue modifications. I didn't actually finish that because I got bored of copying stuff over, but I did move everything off of printf which is a win.