Functional Structures Refactoring Kata
This refactoring kata aims to let you practice with one of the main functional programming building block: Functional Structures.
The starting code (provided in different languages) 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.
How to use this Kata
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.
Proposed Solution
You can take a look at my refactored code (in Scala) wich you will find inside one of the solution-* branchs.
Learning Materials
- Why Functional Programming? It’s the composition - Kailuo Wang
- Functors, Applicatives, And Monads In Pictures - Aditya Bhargava
- Functional Programming with Effects - Rob Norris
- 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
Contributing
Is your favorite language missing? Want to contribute? Awesome! Feel free to submit an Issue or a Pull Request.
License
This project is licensed under the terms of the MIT license.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
