Solving Rock-Paper-Scissors in Type-level Haskell
Let’s solve part 1 of today’s Advent of Code challenge “Rock Paper Scissors” in type-level Haskell.
Instead of using term-level programming as we usually do, we make Haskell’s type system do the work of calculating the solution. So the solution is be known right after we compile the program, and we do not even need to run the compiled program.
Source: Solving Rock-Paper-Scissors in Type-level Haskell, an article by Abhinav Sarkar.