Skip to content

Commit c661114

Browse files
committed
Split out vec-lens and rac-lens, toggable dependencies
- Split out `-lens` packages - Make dependencies on semigroupoids, distributive and adjunctions toggable
1 parent e35fc4f commit c661114

File tree

38 files changed

+2468
-625
lines changed

38 files changed

+2468
-625
lines changed

.travis.yml

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,26 @@ install:
119119
- rm -rf cabal.project cabal.project.local cabal.project.freeze
120120
- touch cabal.project
121121
- |
122+
echo "packages: bin" >> cabal.project
122123
echo "packages: dec" >> cabal.project
123124
echo "packages: fin" >> cabal.project
124-
echo "packages: vec" >> cabal.project
125-
echo "packages: bin" >> cabal.project
126125
echo "packages: ral" >> cabal.project
126+
echo "packages: vec" >> cabal.project
127+
echo "packages: ral-lens" >> cabal.project
128+
echo "packages: vec-lens" >> cabal.project
127129
- |
128-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(bin|dec|fin|ral|vec)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
130+
echo "constraints: ral -semigroupoids" >> cabal.project
131+
echo "constraints: ral -adjunctions" >> cabal.project
132+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(bin|dec|fin|ral|ral-lens|vec|vec-lens)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
129133
- cat cabal.project || true
130134
- cat cabal.project.local || true
135+
- if [ -f "bin/configure.ac" ]; then (cd "bin" && autoreconf -i); fi
131136
- if [ -f "dec/configure.ac" ]; then (cd "dec" && autoreconf -i); fi
132137
- if [ -f "fin/configure.ac" ]; then (cd "fin" && autoreconf -i); fi
133-
- if [ -f "vec/configure.ac" ]; then (cd "vec" && autoreconf -i); fi
134-
- if [ -f "bin/configure.ac" ]; then (cd "bin" && autoreconf -i); fi
135138
- if [ -f "ral/configure.ac" ]; then (cd "ral" && autoreconf -i); fi
139+
- if [ -f "vec/configure.ac" ]; then (cd "vec" && autoreconf -i); fi
140+
- if [ -f "ral-lens/configure.ac" ]; then (cd "ral-lens" && autoreconf -i); fi
141+
- if [ -f "vec-lens/configure.ac" ]; then (cd "vec-lens" && autoreconf -i); fi
136142
- ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
137143
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
138144
- rm cabal.project.freeze
@@ -147,22 +153,28 @@ script:
147153
- cd ${DISTDIR} || false
148154
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
149155
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
156+
- PKGDIR_bin="$(find . -maxdepth 1 -type d -regex '.*/bin-[0-9.]*')"
150157
- PKGDIR_dec="$(find . -maxdepth 1 -type d -regex '.*/dec-[0-9.]*')"
151158
- PKGDIR_fin="$(find . -maxdepth 1 -type d -regex '.*/fin-[0-9.]*')"
152-
- PKGDIR_vec="$(find . -maxdepth 1 -type d -regex '.*/vec-[0-9.]*')"
153-
- PKGDIR_bin="$(find . -maxdepth 1 -type d -regex '.*/bin-[0-9.]*')"
154159
- PKGDIR_ral="$(find . -maxdepth 1 -type d -regex '.*/ral-[0-9.]*')"
160+
- PKGDIR_vec="$(find . -maxdepth 1 -type d -regex '.*/vec-[0-9.]*')"
161+
- PKGDIR_ral_lens="$(find . -maxdepth 1 -type d -regex '.*/ral-lens-[0-9.]*')"
162+
- PKGDIR_vec_lens="$(find . -maxdepth 1 -type d -regex '.*/vec-lens-[0-9.]*')"
155163
# Generate cabal.project
156164
- rm -rf cabal.project cabal.project.local cabal.project.freeze
157165
- touch cabal.project
158166
- |
167+
echo "packages: ${PKGDIR_bin}" >> cabal.project
159168
echo "packages: ${PKGDIR_dec}" >> cabal.project
160169
echo "packages: ${PKGDIR_fin}" >> cabal.project
161-
echo "packages: ${PKGDIR_vec}" >> cabal.project
162-
echo "packages: ${PKGDIR_bin}" >> cabal.project
163170
echo "packages: ${PKGDIR_ral}" >> cabal.project
171+
echo "packages: ${PKGDIR_vec}" >> cabal.project
172+
echo "packages: ${PKGDIR_ral_lens}" >> cabal.project
173+
echo "packages: ${PKGDIR_vec_lens}" >> cabal.project
164174
- |
165-
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(bin|dec|fin|ral|vec)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
175+
echo "constraints: ral -semigroupoids" >> cabal.project
176+
echo "constraints: ral -adjunctions" >> cabal.project
177+
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(bin|dec|fin|ral|ral-lens|vec|vec-lens)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
166178
- cat cabal.project || true
167179
- cat cabal.project.local || true
168180
# Building...
@@ -174,22 +186,42 @@ script:
174186
# Testing...
175187
- if [ $HCNUMVER -ge 80000 ] ; then ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output ; fi
176188
# Doctest...
189+
- if [ $HCNUMVER -ge 80600 ] ; then (cd ${PKGDIR_bin} && doctest src) ; fi
177190
- if [ $HCNUMVER -ge 80600 ] ; then (cd ${PKGDIR_dec} && doctest src) ; fi
178191
- if [ $HCNUMVER -ge 80600 ] ; then (cd ${PKGDIR_fin} && doctest src) ; fi
179-
- if [ $HCNUMVER -ge 80600 ] ; then (cd ${PKGDIR_vec} && doctest src) ; fi
180-
- if [ $HCNUMVER -ge 80600 ] ; then (cd ${PKGDIR_bin} && doctest src) ; fi
181192
- if [ $HCNUMVER -ge 80600 ] ; then (cd ${PKGDIR_ral} && doctest src) ; fi
193+
- if [ $HCNUMVER -ge 80600 ] ; then (cd ${PKGDIR_vec} && doctest src) ; fi
194+
- if [ $HCNUMVER -ge 80600 ] ; then (cd ${PKGDIR_ral_lens} && doctest src) ; fi
195+
- if [ $HCNUMVER -ge 80600 ] ; then (cd ${PKGDIR_vec_lens} && doctest src) ; fi
182196
# cabal check...
197+
- (cd ${PKGDIR_bin} && ${CABAL} -vnormal check)
183198
- (cd ${PKGDIR_dec} && ${CABAL} -vnormal check)
184199
- (cd ${PKGDIR_fin} && ${CABAL} -vnormal check)
185-
- (cd ${PKGDIR_vec} && ${CABAL} -vnormal check)
186-
- (cd ${PKGDIR_bin} && ${CABAL} -vnormal check)
187200
- (cd ${PKGDIR_ral} && ${CABAL} -vnormal check)
201+
- (cd ${PKGDIR_vec} && ${CABAL} -vnormal check)
202+
- (cd ${PKGDIR_ral_lens} && ${CABAL} -vnormal check)
203+
- (cd ${PKGDIR_vec_lens} && ${CABAL} -vnormal check)
188204
# haddock...
189205
- if [ $HCNUMVER -ge 80600 ] ; then ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all | color_cabal_output ; fi
190206
# Building without installed constraints for packages in global-db...
191207
- rm -f cabal.project.local
192208
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
209+
# Constraint sets
210+
- rm -rf cabal.project.local
211+
# Constraint set vec-no-distributive
212+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='vec -distributive' all | color_cabal_output
213+
# Constraint set vec-no-semigroupoids
214+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='vec -semigroupoids' all | color_cabal_output
215+
# Constraint set vec-no-adjunctions
216+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='vec -adjunctions' all | color_cabal_output
217+
# Constraint set ral-no-distributive
218+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='ral -distributive' all | color_cabal_output
219+
# Constraint set ral-no-semigroupoids
220+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='ral -semigroupoids' all | color_cabal_output
221+
# Constraint set ral-no-adjunctions
222+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='ral -adjunctions' all | color_cabal_output
223+
# Constraint set mini
224+
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='vec -adjunctions' --constraint='vec -distributive' --constraint='vec -semigroupoids' --constraint='ral -adjunctions' --constraint='ral -distributive' --constraint='ral -semigroupoids' all | color_cabal_output
193225

194226
# REGENDATA ("0.7.20191106",["--config=cabal.haskell-ci","cabal.project"])
195227
# EOF

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ doctest :
88
doctest --fast -fdiagnostics-color=never bin/src
99
doctest --fast -fdiagnostics-color=never fin/src
1010
doctest --fast -fdiagnostics-color=never vec/src
11+
doctest --fast -fdiagnostics-color=never vec-lens/src
12+
doctest --fast -fdiagnostics-color=never ral-lens/src
1113

1214
ghcid-fin :
1315
ghcid -c 'cabal new-repl fin' -C fin
@@ -18,3 +20,10 @@ ghcid-vec :
1820
deps.png :
1921
cabal build --disable-tests --disable-benchmarks -w ghc-8.6.5 --dry-run all
2022
cabal-plan dot --tred --tred-weights --hide-builtin --output deps.png --run-dot-png
23+
24+
deps-mini.png :
25+
cabal build --disable-tests --disable-benchmarks -w ghc-8.6.5 --dry-run all --constraint="vec -semigroupoids" --constraint="vec -adjunctions" --constraint="vec -distributive" --constraint="ral -semigroupoids" --constraint="ral -adjunctions" --constraint="ral -distributive"
26+
cabal-plan dot --tred --tred-weights --hide-builtin --output deps-mini.png --run-dot-png --root vec --root fin --root dec --root bin --root ral
27+
28+
stats :
29+
for pkg in bin dec fin ral vec ral-lens vec-lens; do echo $$pkg; find $$pkg/src -type f -name '*.hs' | xargs wc; done

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
![](https://raw.githubusercontent.com/phadej/vec/master/deps.png)
2222

23+
And with dependency flags turned off:
24+
25+
![](https://raw.githubusercontent.com/phadej/vec/master/deps-mini.png)
26+
27+
2328
## Benchmarks: dotProduct
2429

2530
- `list` version sets the baseline, built-in fusion seems to kick in.

bin/LICENSE.GPLv2

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,3 @@ proprietary programs. If your program is a subroutine library, you may
337337
consider it more useful to permit linking proprietary applications with the
338338
library. If this is what you want to do, use the GNU Lesser General
339339
Public License instead of this License.
340-
341-
342-
343-
344-
345-
346-
347-
348-

bin/LICENSE.GPLv3

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,3 @@ may consider it more useful to permit linking proprietary applications with
672672
the library. If this is what you want to do, use the GNU Lesser General
673673
Public License instead of this License. But first, please read
674674
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
675-
676-
677-
678-

cabal.haskell-ci

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,30 @@ branches: master
22
tests: >=8.0
33
doctest: >=8.6
44
haddock: >=8.6
5+
6+
constraint-set vec-no-distributive
7+
constraints: vec -distributive
8+
9+
constraint-set vec-no-semigroupoids
10+
constraints: vec -semigroupoids
11+
12+
constraint-set vec-no-adjunctions
13+
constraints: vec -adjunctions
14+
15+
constraint-set ral-no-distributive
16+
constraints: ral -distributive
17+
18+
constraint-set ral-no-semigroupoids
19+
constraints: ral -semigroupoids
20+
21+
constraint-set ral-no-adjunctions
22+
constraints: ral -adjunctions
23+
24+
constraint-set mini
25+
constraints: vec -adjunctions
26+
constraints: vec -distributive
27+
constraints: vec -semigroupoids
28+
29+
constraints: ral -adjunctions
30+
constraints: ral -distributive
31+
constraints: ral -semigroupoids

cabal.project

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
packages: bin
12
packages: dec
23
packages: fin
3-
packages: vec
4-
packages: bin
54
packages: ral
5+
packages: vec
6+
7+
packages: ral-lens
8+
packages: vec-lens
9+
610
tests: true
711

812
package dec
@@ -13,3 +17,11 @@ package fin
1317

1418
package vec
1519
ghc-options: -Wall
20+
21+
-- constraints: vec -distributive
22+
-- constraints: vec -semigroupoids
23+
-- constraints: vec -adjunctions
24+
25+
-- constraints: ral -distributive
26+
-- constraints: ral -semigroupoids
27+
-- constraints: ral -adjunctions

deps-mini.png

14.4 KB
Loading

deps.png

44.3 KB
Loading

fin/fin.cabal

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ tested-with:
6767
source-repository head
6868
type: git
6969
location: https://github.com/phadej/vec.git
70+
subdir: fin
7071

7172
library
7273
exposed-modules:
@@ -118,6 +119,3 @@ test-suite inspection
118119

119120
if !impl(ghc >=8.0)
120121
buildable: False
121-
122-
-- useful for development
123-
ghc-options:

0 commit comments

Comments
 (0)