Functional Data Structures — Stacks
In this article, I will be demonstrating how to implement a classical data structure, the stack, using a functional programming language. In this article, I will be using F# for the demonstration. The goal is to understand how functional programming offers a different perspective on data structures and how to work with them.
Prerequisites
For this article, I will be making assumptions that you already should know what a stack is and have a basic idea or understanding of how it works in an object-oriented language. I do however not expect you to understand anything about F# or how functional programming works. I will be demonstrating and explaining all the necessary new syntax and ideas as we progress.
“Functional programming offers a different perspective and way of thinking about code and how to solve problems. In functional programming, everything revolves around 2 things, types, and functions.”
What's the deal with functional programming?
Functional programming offers a different perspective and way of thinking about code and how to solve problems. In functional programming, everything revolves around 2 things…