This repo contains an implementation of Mark Seemann's KataTennis in Elm.
Mark wrote an article series called Types + Properties = Software.
The stronger a language's type system is, the more you can use static types to model your application's problem domain. With a sufficiently strong type system, you can make illegal states unrepresentable. While states are guaranteed to be legal, transitions between states need not be. You can often use Property-Based Testing to ensure that the state transitions are correct. The combination of types and properties give you a simple, but surprisingly powerful way of specifying the behaviour of the software you create.
Each article from the series has its own commit:
ec3c836– Designing with types
8bb7123– State transition properties
6e5b06f– Properties for the advantage state
90fd83d– Properties for the Forties
0ae1df3– Initial state & Finite state machine
22394a2– Other properties
To run tests, install node-test-runner, go to the root of the repo and call
elm test from the terminal.