vec: Vec: length-indexed (sized) list

[ bsd3, data, library ] [ Propose Tags ]
Versions 0, 0.1
Change log
Dependencies adjunctions (==4.4.*), base (>=4.7 && <4.12), base‑compat (>=0.9.3 && <0.10), deepseq (>= && <1.5), distributive (>=0.5.3 && <0.6), fin (>=0.0.1 && <0.1), hashable (>= && <1.3), lens (==4.16.*), semigroupoids (>=5.2.2 && <5.3), semigroups (==0.18.4.*) [details]
License BSD-3-Clause
Copyright (c) 2017 Oleg Grenrus
Author Oleg Grenrus <>
Maintainer Oleg.Grenrus <>
Category Data
Home page
Bug tracker
Source repo head: git clone
Uploaded by phadej at Fri Mar 16 14:07:13 UTC 2018
Distributions NixOS:0.1
Downloads 324 total (29 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-03-16 [all 1 reports]
Hackage Matrix CI

This package provides length-indexed (sized) lists, also known as vectors.

data Vec n a where
    VNil  :: Vec 'Nat.Z a
    (:::) :: a -> Vec n a -> Vec ('Nat.S n) a

The functions are implemented in three flavours:

As best approach depends on the application, vec doesn't do any magic transformation. Benchmark your code.

This package uses fin, i.e. not GHC.TypeLits, for indexes.

See Hasochism: the pleasure and pain of dependently typed haskell programming by Sam Lindley and Conor McBride for answers to how and why. Read APLicative Programming with Naperian Functors by Jeremy Gibbons for (not so) different ones.

Similar packages




Maintainer's Corner

For package maintainers and hackage trustees