O'Reilly logo

Learning F# Functional Data Structures and Algorithms by Adnan Masood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Let's Stack Up

 

"Whereas some declarative programmers only pay lip service to equational reasoning, users of functional languages exploit them every time they run a compiler, whether they notice it or not."

 
 -- Philip Wadler, How to Declare an Imperative

In the last chapter, we delved into the ubiquitous IEnumerable <T> and sequence type (Seq <T>) which is the alias for it. In this chapter, we shift our focus to another essential data structure, the stack. Stacks, heaps, hash tables, and linked lists are some of the fundamental data structures used in everyday development. In this chapter, we will gain knowledge about stacks by building one as a custom Abstract Data Type (ADT), which is outside the F# core library. Having an in-depth ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required