Haskell Language Vectors The Data.Vector Module

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

The Data.Vector module provided by the vector is a high performance library for working with arrays.

Once you've imported Data.Vector, it's easy to start using a Vector:

Prelude> import Data.Vector
Prelude Data.Vector> let a = fromList [2,3,4]
 
Prelude Data.Vector> a
fromList [2,3,4] :: Data.Vector.Vector
 
Prelude Data.Vector> :t a
a :: Vector Integer

You can even have a multi-dimensional array:

Prelude Data.Vector> let x = fromList [ fromList [1 .. x] | x <- [1..10] ]
 
Prelude Data.Vector> :t x
x :: Vector (Vector Integer)


Got any Haskell Language Question?