source: https://discord.com/channels/632277896739946517/839899003306901545/1028783307623759962
original: https://www.schoolofhaskell.com/user/DanBurton/20-intermediate-exercises
scala version: https://gist.github.com/s5bug/8f761b1ac4d6617beb3f0652b51c9962