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

How it works...

When compared to list, map, and set, vector proposes a very different approach. It is a very efficient collection and most access operations are done with O(1) access. The vector is used in many efficient libraries such as aeson ( a popular library for dealing with JSON), where efficiency and random access is required. The vector itself is immutable and provides effective subsetting through list-like operations.

The mutable vector, on the other hand ,works through monad, by allowing us to programmatically construct the vector and then freeze it to convert it to an immutable vector.

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