F# provides a powerful interface for working with sequences through lists and arrays. Let’s explore how to use these data structures.
When you run this program, you’ll see output similar to:
Note that while F# lists are different from arrays, they are rendered similarly by printfn with the %A format specifier.
F# also provides Array and Seq modules with many useful functions for working with arrays and sequences respectively. These can be used when you need mutable or lazy evaluated sequences.
Now that we’ve seen lists and arrays, we’ll look at F#’s other key data structure: maps.