The vec package

[ Tags: bsd3, data, library ] [ Propose Tags ]

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

Properties

Versions 0
Change log ChangeLog.md
Dependencies adjunctions (==4.3.*), base (>=4.7 && <4.11), base-compat (>=0.9.3 && <0.10), boring (<0.1), deepseq (>=1.3.0.2 && <1.5), distributive (>=0.5.3 && <0.6), fin (<0.1), hashable (>=1.2.6.1 && <1.3), lens (>=4.15.4 && <4.16), semigroupoids (>=5.2.1 && <5.3), semigroups (==0.18.3.*) [details]
License BSD3
Copyright (c) 2017 Oleg Grenrus
Author Oleg Grenrus <oleg.grenrus@iki.fi>
Maintainer Oleg.Grenrus <oleg.grenrus@iki.fi>
Category Data
Home page https://github.com/phadej/vec
Bug tracker https://github.com/phadej/vec/issues
Source repository head: git clone https://github.com/phadej/vec.git
Uploaded Tue Nov 21 12:18:19 UTC 2017 by phadej
Updated Wed Nov 29 19:25:48 UTC 2017 by phadej to revision 1   [What is this?]
Distributions NixOS:0
Downloads 99 total (99 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 2017-11-21 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees