-
Notifications
You must be signed in to change notification settings - Fork 24
/
bytestring-trie.cabal
198 lines (182 loc) · 8.17 KB
/
bytestring-trie.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
Cabal-Version: 2.2
-- Cabal >=2.2 is required for:
-- <https://cabal.readthedocs.io/en/latest/cabal-package.html#common-stanzas>
-- Since 2.1, the Cabal-Version must be the absolutely first thing
-- in the file, even before comments. Also, no longer uses ">=".
-- <https://github.com/haskell/cabal/issues/4899>
----------------------------------------------------------------
-- wren gayle romano <[email protected]> ~ 2024-08-29
----------------------------------------------------------------
Name: bytestring-trie
Version: 0.2.7.5
Build-Type: Simple
Stability: provisional
Homepage: https://wrengr.org/software/hackage.html
Bug-Reports: https://github.com/wrengr/bytestring-trie/issues
Author: wren gayle romano
Maintainer: [email protected]
Copyright: 2008–2024 wren gayle romano
-- Cabal-2.2 requires us to say "BSD-3-Clause" not "BSD3"
License: BSD-3-Clause
License-File: LICENSE
Category: Data, Data Structures
Synopsis: An efficient finite map from bytestrings to values.
Description: An efficient finite map from bytestrings to values.
.
The implementation is based on big-endian patricia trees, like
"Data.IntMap". We first trie on the elements of "Data.ByteString"
and then trie on the big-endian bit representation of those
elements. Patricia trees have efficient algorithms for union
and other merging operations, but they're also quick for lookups
and insertions.
.
If you are only interested in being able to associate strings
to values, then you may prefer the @hashmap@ package which is
faster for those only needing a map-like structure. This package
is intended for those who need the extra capabilities that a
trie-like structure can offer (e.g., structure sharing to reduce
memory costs for highly redundant keys, taking the submap of
all keys with a given prefix, contextual mapping, extracting
the minimum and maximum keys, etc.)
Extra-source-files:
AUTHORS, CHANGELOG, README.md
-- This package ought to work as far back as GHC 7.4.1; however,
-- I've tightened the lower bounds on the Build-Depends to match
-- only what we still verify via CI:
-- <https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history>
-- <https://matrix.hackage.haskell.org/#/package/bytestring-lexing>
-- <https://github.com/wrengr/bytestring-trie/actions?query=workflow%3Aci>
Tested-With:
GHC ==8.0.2,
GHC ==8.2.2,
GHC ==8.4.4,
GHC ==8.6.5,
GHC ==8.8.4,
GHC ==8.10.3,
GHC ==9.0.1,
GHC ==9.2.4,
GHC ==9.4.8,
GHC ==9.6.5,
GHC ==9.8.2,
GHC ==9.10.1
Source-Repository head
Type: git
Location: https://github.com/wrengr/bytestring-trie.git
----------------------------------------------------------------
-- This stanza requires Cabal>=2.2:
-- <https://cabal.readthedocs.io/en/latest/cabal-package.html#common-stanzas>
-- While Cabal-2.2 only ships with GHC 8.4.1, the dependencies to
-- build it have essentially the same lower bounds as we do. (They
-- require bytestring>=0.9.2.1 and deepseq>=1.3) So users of older
-- GHC should still be able to compile it; and if they can't, then
-- they already can't compile this package.
--
-- N.B., the "import:" field must be the first thing in a stanza.
Common library-build-depends
Default-Language: Haskell2010
Build-Depends: base >= 4.9 && < 4.21
, bytestring >= 0.10.8 && < 0.13
, binary >= 0.8.3 && < 0.9
, deepseq >= 1.4.2 && < 1.6
-- TODO: in lieu of using CPP to expose internals to the tests/benchmarks,
-- we should consider using:
-- <https://cabal.readthedocs.io/en/latest/cabal-package.html#sublibs>
Library
Import: library-build-depends
Hs-Source-Dirs: src
Exposed-Modules: Data.Trie
, Data.Trie.Convenience
, Data.Trie.Internal
Other-Modules: Data.Trie.Internal.BitTwiddle
, Data.Trie.Internal.ByteString
, Data.Trie.Internal.Errors
----------------------------------------------------------------
-- See the cabal file for bytestring-lexing for more info about
-- setting up Tasty.
Test-Suite test-all
Import: library-build-depends
Type: exitcode-stdio-1.0
Hs-Source-Dirs: dev
-- NOTE: Test-Suite Main-Is is relative to Hs-Source-Dirs;
-- unlike Executable Main-Is, which is relative to this cabal
-- file's directory instead.
Main-Is: Test/Main.hs
Other-Modules: Shared.BaseCompat
, Test.Utils
, Test.Properties
-- Test.Validity
-- Test.ByteStringInternal
-- We must include our own library for the tests to use it; but
-- we must not give a version restriction lest Cabal give warnings.
-- There's also bug <https://github.com/haskell/cabal/issues/5119>:
-- if we don't pass -any, then Cabal will fill in ">= 0 && <= $ThisVersion"
-- which will also give a warning.
Build-Depends: bytestring-trie -any
, tasty >= 0.10.1.2 && < 1.6
, tasty-smallcheck >= 0.8.0.1 && < 0.9
, tasty-quickcheck >= 0.8.3.2 && < 0.12
-- N.B., @tasty-hunit@ is just a partial API clone;
-- whereas @tasty-hunit-compat@ is a proper integration
-- with HUnit itself. Also, tasty-hunit-compat actually
-- depends on tasty-hunit; if you're wanting to minimize
-- dependencies.
, tasty-hunit < 0.11
, QuickCheck >= 2.10 && < 2.16
, smallcheck >= 1.1.1 && < 1.3
-- lazysmallcheck >= 0.6 && < 0.7
----------------------------------------------------------------
-- Can't put the "Type:" field in here; or rather even if we do,
-- it's still required in each of the Benchmark stanzas...
Common bench-common
Import: library-build-depends
if impl(ghc)
GHC-Options: -with-rtsopts=-A32m
-- TODO: this was recommended somewhere for benchmarks, but is
-- --nonmoving-gc actually good for our use case? (It's
-- concurrent-mark&sweep for the old generations; instead of
-- the default stop-the-world generational copying collector)
--if impl(ghc >= 8.10)
-- GHC-Options: -with-rtsopts=--nonmoving-gc
if impl(ghc)
GHC-Options: -Wall -O2 -rtsopts
Hs-Source-Dirs: dev
Build-Depends: bytestring-trie -any
-- TODO: try using @gauge@ instead of @criterion@,
-- to reduce the transitive dependencies.
-- BUG: @gauge@ depends on @basement@ which as of
-- version 0.0.12 doesn't support GHC 9.2; so we'll
-- have to revisit this later.
--
-- NOTE: If you're having issues building on ghc-9.6,
-- then be sure to update your cabal info.
-- The parallel-3.2.2.0 package has metadata revisions
-- to allow building with base-4.18.
, criterion
, QuickCheck >= 2.10 && < 2.16
Benchmark bench-Regression
Import: bench-common
Type: exitcode-stdio-1.0
-- NOTE: Benchmark Main-Is behaves like Test-Suite Main-Is
-- (not like Executable Main-Is).
Main-Is: Bench/Regression.hs
if impl(ghc)
GHC-Options: -main-is Bench.Regression.main
Other-Modules: Shared.BaseCompat
, Bench.Foldable
Benchmark bench-Foldable
Import: bench-common
Type: exitcode-stdio-1.0
Main-Is: Bench/Foldable.hs
if impl(ghc)
GHC-Options: -main-is Bench.Foldable.main
Other-Modules: Shared.BaseCompat
Benchmark bench-MatchOne
Import: bench-common
Type: exitcode-stdio-1.0
Main-Is: Bench/MatchOne.hs
Benchmark bench-UnionWith
Import: bench-common
Type: exitcode-stdio-1.0
Main-Is: Bench/UnionWith.hs
----------------------------------------------------------------
----------------------------------------------------------- fin.