summaryrefslogtreecommitdiff
blob: 95e22703be1426dece74558a3f6131d3bcd07624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
	<maintainer type="project">
		<email>haskell@gentoo.org</email>
		<name>Gentoo Haskell</name>
	</maintainer>
	<longdescription>
		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:
		
		&gt;
		&gt;import qualified Data.Vector as A
		&gt;import qualified VectorBuilder.Builder as B
		&gt;import qualified VectorBuilder.Vector as C
		&gt;
		&gt;
		&gt;myVector :: A.Vector a -&gt; [a] -&gt; a -&gt; A.Vector a
		&gt;myVector vector list element =
		&gt;  C.build builder
		&gt;  where
		&gt;    builder =
		&gt;      B.vector vector &lt;&gt;
		&gt;      foldMap B.singleton list &lt;&gt;
		&gt;      B.singleton element
	</longdescription>
</pkgmetadata>