The vector-builder package

[Tags:library, mit, test]

An API for efficient and convenient construction of vectors. It provides the composable Builder abstraction, which has instances of the Monoid and Semigroup classes.

Usage

First you use the Builder abstraction to specify the structure of the vector. Then you execute the builder to actually produce the vector.

Example

The following code shows how you can efficiently concatenate different datastructures into a single immutable vector:

import qualified Data.Vector as A
import qualified VectorBuilder.Builder as B
import qualified VectorBuilder.Vector as C


myVector :: A.Vector a -> [a] -> a -> A.Vector a
myVector vector list element =
  C.build builder
  where
    builder =
      B.vector vector <>
      foldMap B.singleton list <>
      B.singleton element

Properties

Versions 0.1, 0.1.1, 0.2, 0.3, 0.3.1
Dependencies base (>=4.6 && <5), base-prelude (<2), semigroups (>=0.16 && <0.20), vector (>=0.11 && <0.13) [details]
License MIT
Copyright (c) 2016, Nikita Volkov
Author Nikita Volkov <nikita.y.volkov@mail.ru>
Maintainer Nikita Volkov <nikita.y.volkov@mail.ru>
Category Vector
Home page https://github.com/nikita-volkov/vector-builder
Bug tracker https://github.com/nikita-volkov/vector-builder/issues
Source repository head: git clone git://github.com/nikita-volkov/vector-builder.git
Uploaded Sat Apr 8 19:28:12 UTC 2017 by NikitaVolkov
Distributions Arch:0.3.1, NixOS:0.3.1, Stackage:0.3.1
Downloads 576 total (145 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2017-04-08 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees