-
Notifications
You must be signed in to change notification settings - Fork 27
/
compdata.cabal
358 lines (336 loc) · 13.3 KB
/
compdata.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
Name: compdata
Version: 0.13.1
Synopsis: Compositional Data Types
Description:
This library implements the ideas of
<http://dx.doi.org/10.1017/S0956796808006758 Data types a la carte>
as outlined in the paper
<http://dx.doi.org/10.1145/2036918.2036930 Compositional data types>. The
purpose of this library is to allow the programmer to construct data
types -- as well as the functions defined on them -- in a modular
fashion. The underlying idea is to separate the signature of a data
type from the fixed point construction that produces its recursive
structure. Signatures can then be composed and decomposed freely.
.
Building on that foundation, this library provides additional
extensions and (run-time) optimisations which make compositional data types
usable for practical implementations. In particular, it
provides an excellent framework for manipulating and analysing
abstract syntax trees in a type-safe manner. Thus, it is perfectly
suited for programming language implementations, especially, in an environment
consisting of a family of tightly interwoven /domain-specific languages/.
.
In concrete terms, this library provides the following features:
.
* Compositional data types in the style of Wouter Swierstra's
Functional Pearl /Data types a la carte/. The implementation of
signature subsumption is based on the paper
/Composing and Decomposing Data Types/ (Workshop on Generic
Programming, 2014, to appear), which makes signature composition more
flexible.
.
* Modular definition of functions on compositional data types through
catamorphisms and anamorphisms as well as more structured
recursion schemes such as primitive recursion and co-recursion,
and course-of-value iteration and co-iteration.
.
* Support for monadic computations via monadic variants of all
recursion schemes.
.
* Support of a succinct programming style over compositional data types
via generic programming combinators that allow various forms of
generic transformations and generic queries.
.
* Generalisation of compositional data types (terms) to
compositional data types \"with holes\" (contexts). This allows
flexible reuse of a wide variety of catamorphisms (called
/term homomorphisms/) as well as an efficient composition of them.
.
* Operations on signatures, for example, to add and remove
annotations of abstract syntax trees. This includes combinators to
propagate annotations fully automatically through certain
term homomorphisms.
.
* Optimisation of the implementation of recursion schemes. This
includes /short-cut fusion/ style optimisation rules which yield a
performance boost of up to factor six.
.
* Automatic derivation of instances of all relevant type classes for
using compositional data types via /Template Haskell/. This includes
instances of 'Prelude.Eq', 'Prelude.Ord' and 'Prelude.Show' that are
derived via instances for functorial variants of them. Additionally,
also /smart constructors/, which allow to easily construct inhabitants
of compositional data types, are automatically generated.
.
* /Mutually recursive data types/ and
/generalised algebraic data types (GADTs)/. All of the above is also lifted
to families of mutually recursive data types and (more generally) GADTs.
This extension resides in the module "Data.Comp.Multi".
.
Examples of using (generalised) compositional data types are bundled
with the package in the folder @examples@.
.
There are some supplementary packages, some of which were included
in previous versions of this package:
.
* <https://hackage.haskell.org/package/compdata-param compdata-param>:
a parametric variant of compositional data types to deal with variable
binders in a systematic way.
.
* <https://hackage.haskell.org/package/compdata-automata compdata-automata>:
advanced recursion schemes derived from tree automata that allow for a
higher degree of modularity and make it possible to apply fusion.
.
* <https://hackage.haskell.org/package/compdata-dags compdata-dags>:
recursion schemes on directed acyclic graphs.
Category: Generics
License: BSD3
License-file: LICENSE
Author: Patrick Bahr, Tom Hvitved
Maintainer: paba@itu.dk
Build-Type: Simple
Cabal-Version: >=1.9.2
bug-reports: https://github.com/pa-ba/compdata/issues
extra-source-files:
CHANGELOG.md
-- test files
testsuite/tests/*.hs
testsuite/tests/Data/*.hs
testsuite/tests/Data/Comp/*.hs
testsuite/tests/Data/Comp/Multi/*.hs
testsuite/tests/Data/Comp/Examples/*.hs
testsuite/tests/Test/Utils.hs
-- benchmark files
benchmark/*.hs
benchmark/DataTypes/*.hs
benchmark/Functions/*.hs
benchmark/Functions/Comp/*.hs
benchmark/Functions/Standard/*.hs
benchmark/Multi/DataTypes/*.hs
benchmark/Multi/Functions/Comp/*.hs
-- example files
examples/Examples/*.hs
examples/Examples/Multi/*.hs
library
Exposed-Modules: Data.Comp
Data.Comp.Annotation
Data.Comp.Sum
Data.Comp.Term
Data.Comp.Algebra
Data.Comp.Equality
Data.Comp.Ordering
Data.Comp.DeepSeq
Data.Comp.Generic
Data.Comp.TermRewriting
Data.Comp.Arbitrary
Data.Comp.Show
Data.Comp.Render
Data.Comp.Variables
Data.Comp.Decompose
Data.Comp.Unification
Data.Comp.Derive
Data.Comp.Derive.Utils
Data.Comp.Matching
Data.Comp.Desugar
Data.Comp.Mapping
Data.Comp.Thunk
Data.Comp.Ops
Data.Comp.Projection
Data.Comp.Multi
Data.Comp.Multi.Term
Data.Comp.Multi.Sum
Data.Comp.Multi.HFunctor
Data.Comp.Multi.HFoldable
Data.Comp.Multi.HTraversable
Data.Comp.Multi.Algebra
Data.Comp.Multi.Annotation
Data.Comp.Multi.Show
Data.Comp.Multi.Equality
Data.Comp.Multi.Ordering
Data.Comp.Multi.Variables
Data.Comp.Multi.Ops
Data.Comp.Multi.Mapping
Data.Comp.Multi.Derive
Data.Comp.Multi.Generic
Data.Comp.Multi.Desugar
Data.Comp.Multi.Projection
Other-Modules: Data.Comp.SubsumeCommon
Data.Comp.Derive.Equality
Data.Comp.Derive.Ordering
Data.Comp.Derive.Arbitrary
Data.Comp.Derive.Show
Data.Comp.Derive.DeepSeq
Data.Comp.Derive.SmartConstructors
Data.Comp.Derive.SmartAConstructors
Data.Comp.Derive.Foldable
Data.Comp.Derive.Traversable
Data.Comp.Derive.HaskellStrict
Data.Comp.Multi.Derive.HFunctor
Data.Comp.Multi.Derive.HFoldable
Data.Comp.Multi.Derive.HTraversable
Data.Comp.Multi.Derive.Equality
Data.Comp.Multi.Derive.Ordering
Data.Comp.Multi.Derive.Show
Data.Comp.Multi.Derive.SmartConstructors
Data.Comp.Multi.Derive.SmartAConstructors
Build-Depends: base >= 4.16 && < 4.20,
QuickCheck >= 2.14.3 && < 2.15,
containers >= 0.6.5 && < 0.8,
deepseq >= 1.4 && < 1.6,
template-haskell >= 2.17 && < 2.22,
mtl >= 2.2.2 && < 2.4,
transformers >= 0.5.6 && < 0.7,
th-expand-syns >= 0.4.11 && < 0.5,
tree-view >= 0.5.1 && < 0.6
Default-Language: Haskell2010
Default-Extensions: FlexibleContexts
hs-source-dirs: src
ghc-options: -W
Test-Suite test
Type: exitcode-stdio-1.0
Main-is: Data_Test.hs
hs-source-dirs: testsuite/tests examples src
Build-Depends: base >= 4.16 && < 5,
HUnit,
QuickCheck >= 2,
containers, mtl >= 2.2.1,
deepseq,
template-haskell,
test-framework,
test-framework-hunit,
test-framework-quickcheck2 >= 0.3,
th-expand-syns,
transformers
Default-Language: Haskell2010
ghc-options: -W -Wno-incomplete-patterns
Other-Modules:
Data.Comp
Data.Comp.Algebra
Data.Comp.Annotation
Data.Comp.Arbitrary
Data.Comp.Derive
Data.Comp.Derive.Arbitrary
Data.Comp.Derive.DeepSeq
Data.Comp.Derive.Equality
Data.Comp.Derive.Foldable
Data.Comp.Derive.HaskellStrict
Data.Comp.Derive.Ordering
Data.Comp.Derive.Show
Data.Comp.Derive.SmartAConstructors
Data.Comp.Derive.SmartConstructors
Data.Comp.Derive.Traversable
Data.Comp.Derive.Utils
Data.Comp.Desugar
Data.Comp.Equality
Data.Comp.Equality_Test
Data.Comp.Examples.Comp
Data.Comp.Examples.Multi
Data.Comp.Examples_Test
Data.Comp.Generic
Data.Comp.Mapping
Data.Comp.Multi
Data.Comp.Multi.Algebra
Data.Comp.Multi.Annotation
Data.Comp.Multi.Derive
Data.Comp.Multi.Derive.Equality
Data.Comp.Multi.Derive.HFoldable
Data.Comp.Multi.Derive.HFunctor
Data.Comp.Multi.Derive.HTraversable
Data.Comp.Multi.Derive.Ordering
Data.Comp.Multi.Derive.Show
Data.Comp.Multi.Derive.SmartAConstructors
Data.Comp.Multi.Derive.SmartConstructors
Data.Comp.Multi.Desugar
Data.Comp.Multi.Equality
Data.Comp.Multi.Generic
Data.Comp.Multi.HFoldable
Data.Comp.Multi.HFunctor
Data.Comp.Multi.HTraversable
Data.Comp.Multi.Mapping
Data.Comp.Multi.Ops
Data.Comp.Multi.Ordering
Data.Comp.Multi.Show
Data.Comp.Multi.Sum
Data.Comp.Multi.Term
Data.Comp.Multi.Variables
Data.Comp.Multi.Variables_Test
Data.Comp.Multi_Test
Data.Comp.Ops
Data.Comp.Ordering
Data.Comp.Show
Data.Comp.SubsumeCommon
Data.Comp.Subsume_Test
Data.Comp.Sum
Data.Comp.Term
Data.Comp.Thunk
Data.Comp.Variables
Data.Comp.Variables_Test
Data.Comp_Test
Examples.Common
Examples.Desugar
Examples.Eval
Examples.EvalM
Examples.Thunk
Examples.Multi.Common
Examples.Multi.Desugar
Examples.Multi.Eval
Examples.Multi.EvalI
Examples.Multi.EvalM
Test.Utils
Benchmark algebra
Type: exitcode-stdio-1.0
Main-is: Benchmark.hs
hs-source-dirs: src benchmark
ghc-options: -W -O2
-- Disable short-cut fusion rules in order to compare optimised and unoptimised code.
cpp-options: -DNO_RULES
Build-Depends: base >= 4.16 && < 5, template-haskell, containers, mtl >= 2.2.1,
QuickCheck >= 2, deepseq, criterion, random, uniplate, transformers,
th-expand-syns
Default-Language: Haskell2010
Other-Modules:
Data.Comp
Data.Comp.Algebra
Data.Comp.Annotation
Data.Comp.Arbitrary
Data.Comp.DeepSeq
Data.Comp.Derive
Data.Comp.Derive.Arbitrary
Data.Comp.Derive.DeepSeq
Data.Comp.Derive.Equality
Data.Comp.Derive.Foldable
Data.Comp.Derive.HaskellStrict
Data.Comp.Derive.Ordering
Data.Comp.Derive.Show
Data.Comp.Derive.SmartAConstructors
Data.Comp.Derive.SmartConstructors
Data.Comp.Derive.Traversable
Data.Comp.Derive.Utils
Data.Comp.Equality
Data.Comp.Generic
Data.Comp.Mapping
Data.Comp.Ops
Data.Comp.Ordering
Data.Comp.Show
Data.Comp.SubsumeCommon
Data.Comp.Sum
Data.Comp.Term
Data.Comp.Thunk
Data.Comp.Variables
DataTypes
DataTypes.Comp
DataTypes.Standard
DataTypes.Transform
Functions.Comp
Functions.Comp.Desugar
Functions.Comp.Eval
Functions.Comp.FreeVars
Functions.Comp.Inference
Functions.Standard
Functions.Standard.Desugar
Functions.Standard.Eval
Functions.Standard.FreeVars
Functions.Standard.Inference
source-repository head
type: git
location: https://github.com/pa-ba/compdata