-
Notifications
You must be signed in to change notification settings - Fork 4
/
acts.cabal
110 lines (91 loc) · 2.87 KB
/
acts.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
cabal-version: 2.4
name: acts
version: 0.3.1.1
synopsis: Semigroup actions and torsors.
category: Algebra, Math
license: BSD-3-Clause
build-type: Simple
author: Sam Derbyshire
maintainer: Sam Derbyshire
homepage: https://github.com/sheaf/acts
bug-reports: https://github.com/sheaf/acts/issues
extra-source-files:
changelog.md
extra-doc-files:
img/*.svg
description:
Acts and torsors model types which can be transformed under the action of another type.
.
A prototypical example is affine space, which has an action by translation:
given any two points in affine space, there is a unique translation that brings one to the other.
.
This can be useful in a library keeping track of time: on top of needing to keep track
of units, one also needs to distinguish between absolute time (time stamps) and relative time
(time differences).
The operations one expects in this situation are:
.
* Addition and subtraction of time differences: time differences form a (commutative) group.
* Translation of an absolute time by a time difference: there is an action of relative time on absolute time.
* Given two absolute times, one can obtain the time difference between them: absolute time is a torsor under relative time.
.
This library provides a convenient framework which helps to avoid mixing up these two different notions.
.
.
A fleshed out example is available at "Acts.Examples.MusicalIntervals",
which showcases the use of actions and torsors in the context of musical intervals and harmony.
It also demonstrates common usage patterns of this library, such as how to automatically derive instances.
.
See also the [project readme](https://github.com/sheaf/acts),
which includes a simple example with 2D affine space.
source-repository head
type: git
location: git://github.com/sheaf/acts.git
flag finitary
description:
Use the 'finitary' library to define actions on finite enumerations.
.
Disable to remove dependencies on `finite-typelits` and `finitary`.
default: True
manual: True
common common
build-depends:
base
>= 4.12 && < 4.21
, groups
>= 0.4.0.0 && < 0.6
if flag(finitary)
cpp-options:
-DFIN
build-depends:
finitary
>= 1.2.0.0 && < 2.2
, finite-typelits
>= 0.1.4.2 && < 0.1.7
default-language:
Haskell2010
ghc-options:
-O2
-Wall
-Wcompat
-fwarn-missing-local-signatures
-fwarn-incomplete-uni-patterns
-fwarn-missing-deriving-strategies
library
import:
common
hs-source-dirs:
src
exposed-modules:
Data.Act
build-depends:
deepseq
^>= 1.4.4.0
library acts-examples
import:
common
hs-source-dirs:
examples
exposed-modules:
Acts.Examples.MusicalIntervals
build-depends:
acts