This refactoring kata aims to let you practice with one of the main functional programming building block: Functional Structures.
The starting code implements a use case with an imperative approach. Your mission is to remove every effects (aka computational context) within the applyDiscount
function with the power of Functional Structures.
The code is implemented in different languages. Is your favorite language missing? Please consider to contribute with a Pull Request or open an Issue.
The simplest way is to just clone the code and start hacking right away improving the design. The project includes some tests useful to make sure you don't break the code while you refactor.
You can take a look at my refactored code (in Scala) wich you will find inside the solution branch.
- Why Functional Programming? It’s the composition - Kailuo Wang
- Functors, Applicatives, And Monads In Pictures - Aditya Bhargava
- Scala Typeclassopedia - John Kodumal
- Functional Structures in Scala - Michael Pilquist
- A Pragmatic Introduction to Category Theory - Daniela Sfregola
- Category Theory for the Working Hacker - Philip Wadler
This project is licensed under the terms of the MIT license.