vector: Efficient Arrays

[ bsd3, data, data-structures, library ] [ Propose Tags ]

An efficient implementation of Int-indexed arrays (both mutable and immutable), with a powerful loop optimisation framework .

It is structured as follows:

Boxed vectors of arbitrary types.
Unboxed vectors with an adaptive representation based on data type families.
Unboxed vectors of Storable types.
Unboxed vectors of primitive types as defined by the primitive package. Data.Vector.Unboxed is more flexible at no performance cost.
Generic interface to the vector types.

Each module has a Safe version with is marked as Trustworthy (see

There is also a (draft) tutorial on common uses of vector.

Please use the project trac to submit bug reports and feature requests.

Changes in version 0.9

  • MonadPlus instance for boxed vectors

  • Export more construct and constructN from Safe modules

  • Require primitive-

Changes in version 0.8

  • New functions: constructN, constructrN

  • Support for GHC 7.2 array copying primitives

  • New fixity for (!)

  • Safe Haskell support (contributed by David Terei)

  • Functor, Monad, Applicative, Alternative, Foldable and Traversable instances for boxed vectors (WARNING: they tend to be slow and are only provided for completeness)

  • Show instances for immutable vectors follow containers conventions

  • Read instances for all immutable vector types

  • Performance improvements


Automatic Flags

Enable bounds checking


Enable bounds checking in unsafe operations at the cost of a significant performance penalty


Enable internal consistency checks at the cost of a significant performance penalty


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 0.1, 0.2, 0.3, 0.3.1, 0.4, 0.4.1, 0.4.2, 0.5, 0.6,,, 0.7,, 0.7.1, 0.8, 0.9, 0.9.1, 0.10,,,,,,,,,,,,,,,,,,,,,,,, (info)
Change log Changelog
Dependencies base (>=4 && <5), primitive (>= && <0.5) [details]
License BSD-3-Clause
Copyright (c) Roman Leshchinskiy 2008-2011
Author Roman Leshchinskiy <>
Maintainer Roman Leshchinskiy <>
Category Data, Data Structures
Home page
Bug tracker
Uploaded by RomanLeshchinskiy at 2011-08-30T19:33:07Z
Distributions Arch:, Debian:, Fedora:, FreeBSD:, LTSHaskell:, NixOS:, Stackage:, openSUSE:
Reverse Dependencies 2024 direct, 12582 indirect [details]
Downloads 416292 total (610 in the last 30 days)
Rating 2.75 (votes: 13) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]