Book Image

Learning F# Functional Data Structures and Algorithms

By : Adnan Masood
Book Image

Learning F# Functional Data Structures and Algorithms

By: Adnan Masood

Overview of this book

Table of Contents (21 chapters)
Learning F# Functional Data Structures and Algorithms
Credits
Foreword
Foreword
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 9. Sets, Maps, and Vectors of Indirections

 

"All problems in computer science can be solved by another level of indirection, except of course for the problem of too many indirections."

 
 -- David Wheeler
 

"A language that doesn't affect the way you think about programming is not worth knowing."

 
 -- Alan J. Perlis

In the last chapter, we reviewed graphs and the related algorithms, starting with basic graph terminology and delved into how to represent graphs in a functional programming setting. We then used the graph data structure to implement Dijkstra's algorithm and provided a brief primer to the graphics libraries for modeling graphs.

In this chapter, we are going to review sets and maps, and will explore a custom implementation of a vector. Additionally, we are going to discuss intermediate language and how it works in the .NET ecosystem. We will also cover F# IL generation and compare it with C#.

In this chapter, we will cover the following topics:

  • Sets and maps

  • Vectors and...