O'Reilly logo

Haskell Cookbook by Yogesh Sajanikar

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

Working with vector

In this recipe, we will look at Data.Vector from the vector package. So far, we have been extensively using lists. Though lists are ubiquitous in Haskell, they are not efficient where array-like access and operations are required. A vector supports arrays such as O(1) access to elements, as well as list-like incremental access. The vectors come in two flavorsimmutable and mutable. We will look at both in this recipe.

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