The countdown problem was presented in a paper by Graham Hutton with a simple and elegant solution in Haskell. See the paper here. In this post I'll implement the same solution in Rust and see how it looks compared to the original Haskell solution.
Rust is a modern, multi paradigm language with the following primary goals:
Performance (zero cost abstractions) Reliability (no data races) Rust is strongly influenced by functional programming languages like ML, so it is possible to follow a functional coding style in it.
This is not an attempt to be yet another Monad tutorial. There are probably more Monad tutorials than one can read already out there - see this timeline or do a google search. This rather is a simple introduction to understand Monads based on the Essence of FP paper.
This is a learning roadmap for Functional Programming (FP). There are quite a lot of resources to learn FP on the web (just like on any subject). So the challenge is not to find a resource to learn, but to find quality resources.
This is part of a series of articles on implementing various functional data structures in Scala. See other articles in this series:
Functional Stacks Functional Sets In this part we will implement a basic Priority Queue in Scala. It will support the following operations efficiently: