-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfleet-array.cabal
60 lines (54 loc) · 2.25 KB
/
fleet-array.cabal
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
cabal-version: 3.8
name: fleet-array
version: 0.1.0.0
license: BSD-3-Clause
license-file: LICENSE
author: Jaro Reinders
maintainer: [email protected]
build-type: Simple
category: Data, Data Structures, Array
synopsis: Fleet arrays are pure, but support fast updates if used linearly
tested-with: GHC ==9.10.1 || ==9.8.4 || ==9.6.6
description:
Updating a pure array in Haskell usually requires copying the whole array,
which takes linear time. For constant-time array updates, you would need to
use a monadic interface, manually specifying the order of evaluation. Fleet
arrays strike a balance between these two extremes. In common usage patterns,
where old versions of arrays not reused after they are updated, fleet arrays
support constant time indexing and updates. Accessing old versions does incur
performance overhead. We hope this package can form the basis of a pure
and performant array library.
Fleet arrays can be more than 10x faster than 'IntMap' if used densly and
linearly.
The ideas behind fleet arrays are due to
[Baker in 1991](https://doi.org/10.1145/122598.122614), who called them shallow
arrays. These ideas were first implemented in Haskell by Simon Marlow as part
of GHC (now moved to the
[diffarray](https://hackage.haskell.org/package/diffarray) package).
Fleet arrays provide a simpler vector-like interface and offer better
performance.
common warnings
ghc-options: -Wall
library
import: warnings
exposed-modules: Fleet.Array
other-modules: Fleet.Array.MutVar, Fleet.Array.Lift, Fleet.Array.MutArray
build-depends: base ^>= {4.18,4.19,4.20}
hs-source-dirs: src/
default-language: GHC2021
benchmark fleet-array-bench
import: warnings
main-is: Bench.hs
other-modules: Array
, Quicksort
, QuicksortMA
, QuicksortIM
, Eratosthenes
, EratosthenesMA
, MutArr
build-depends: base, fleet-array, tasty-bench ^>= {0.4.1}, containers
hs-source-dirs: bench/
default-language: GHC2021
source-repository head
type: git
location: https://github.com/noughtmare/fleet-array