vector-sized: Size tagged vectors

[ bsd3, data, library ] [ Propose Tags ]

Please see

[Skip to Readme]
Versions [faq],,,,,,,,,,,,,,,,,,,
Change log
Dependencies adjunctions (>=4.3 && <4.5), base (>=4.9 && <5), comonad (>=4 && <6), deepseq (>=1.1 && <1.5), distributive (>=0.5 && <0.7), finite-typelits (>=0.1), indexed-list-literals (>=, primitive (>=0.5 && <0.7), vector (>=0.11 && <0.13) [details]
License BSD-3-Clause
Copyright 2016 Joe Hermaszewski
Author Joe Hermaszewski
Category Data
Home page
Source repo head: git clone
Uploaded by jophish at Tue Nov 13 14:43:22 UTC 2018
Distributions LTSHaskell:, NixOS:, Stackage:
Downloads 4690 total (330 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for vector-sized-

[back to package description]

Vector Sized

This package exports a newtype tagging the vectors from the vector package with a type level natural representing their size. It also exports a few functions from vector appropriately retyped.

This package is fairly similar to the fixed-vector package. While both provide vectors of statically know length they use completely different implementation with different tradeoffs. vector-sized is a newtype wrapper over vector thus it's able to handle vectors of arbitrary length but have to carry runtime representation of length which is significant memory overhead for small vectors. fixed-vector defines all functions as manipulations of Church-encoded product types (∀r. (a→a→r) → r for 2D vectors) so it can work for both arbitrary product types like data V2 a = V2 a a and opaque length-parametrized vectors provided by library. As consequence of implementation it can't handle vectors larger than tens of elements.

The initial code for this package was written by @bgamari in a PR for vulkan