This kata is based on the awesome talk by Scott Wlaschin.
The talk shows how techniques found in functional programming, allow your code to explain it's logic clearly, without having to litter it with "if-then-else" soup, complicated error handling, and try/catch/finally blocks.
To watch the talk, follow the links on this page: https://fsharpforfunandprofit.com/rop/
This Kata gets you to:
- implement the data types for "one track" and "two track" railway programming.
- implement the functions Scott uses in the talk to write your business logic, without having to worry about wiring in all the error cases.
-
Clone the repo
-
Open the project in your IDE (I assume you have Kotlin installed)
-
Navigate to
src/test/Part1_createOption.kt
Functional programming can seem daunting. The field of study is massive, so I wanted to introduce some of the concepts with some simple examples and code. I think Scott's talk is brilliant and demonstrates another one of the great reasons to adopt function programming.