TL;DR;

I name it Russian Roulette. That takes the term winner to a new whole level of “winning”. The application is a stateful HTTP server (LOL) built on top of the network package.

You could checkout my latest code here https://github.com/khanhhua/russian-roulette. Do a cabal run. Go to http://localhost:3000. Available commands are:

  • show :: show the current state of the application
  • join your_name :: append a name to the active members of the game
  • roll :: spin the roulette

Ingredients

  • HTTP with custom methods
  • Local file system
  • Typeclass
  • MVar
  • IO a monad
  • … and a bunch of $, <>, <$> add <*> so that I could be called a Haskeller ;). Well, to understand the language, I gotta use typical idioms as mental exercises.

References

  • Functional Programming Patterns for Mere Mortals - Daniel Chambers https://youtu.be/v9QGWbGppis
  • Functional architecture - The pits of success - Mark Seemann https://youtu.be/US8QG9I1XW0
  • Practical Haskell - https://link.springer.com/book/10.1007/978-1-4842-4480-7
  • Haskell in Depth - https://www.manning.com/books/haskell-in-depth
  • Category Theory by Dr.Bartosz Milewski [https://youtube.com/playlist?list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_]