on develop help sign in
Merge pull request #336 from reflex-frp/phadej-haskell-ci
c6259c8Oliver Batchelor
.travis.ymlnew file+182
@@ -0,0 +1,182 @@
1+# This Travis job script has been generated by a script via
2+#
3+# haskell-ci '--config=cabal.haskell-ci' 'cabal.project'
4+#
5+# For more information, see https://github.com/haskell-CI/haskell-ci
6+#
7+# version: 0.3.20190804.2
8+#
9+language: c
10+dist: xenial
11+sudo: required
12+git:
13+ # whether to recursively clone submodules
14+ submodules: false
15+cache:
16+ directories:
17+ - $HOME/.cabal/packages
18+ - $HOME/.cabal/store
19+before_cache:
20+ - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
21+ # remove files that are regenerated by 'cabal update'
22+ - rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
23+ - rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
24+ - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
25+ - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
26+ - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
27+ - rm -rfv $CABALHOME/packages/head.hackage
28+
29+matrix:
30+ include:
31+ - compiler: ghcjs-8.4
32+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-3.0"]}}
33+ env: GHCJS_PACKAGE="ghcjs-8.4"
34+ - compiler: ghc-8.6.5
35+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}
36+ - compiler: ghc-8.4.4
37+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}}
38+ - compiler: ghc-8.2.2
39+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-2.4"]}}
40+ - compiler: ghc-8.0.2
41+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-2.4"]}}
42+ allow_failures:
43+ - compiler: "ghcjs-8.4" # This hits the travis 50min time limit and fails
44+
45+before_install:
46+ - |
47+ if [ "$TRAVIS_OS_NAME" = "linux" ] && [ ! -z "$GHCJS_PACKAGE" ]; then
48+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -;
49+ sudo sh -c "echo deb https://deb.nodesource.com/node_8.x xenial main > /etc/apt/sources.list.d/nodesource.list";
50+ sudo add-apt-repository -y ppa:hvr/ghcjs;
51+ sudo apt-get update;
52+ sudo apt-get install nodejs;
53+ sudo apt-get install "$GHCJS_PACKAGE";
54+ fi
55+ - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
56+ - WITHCOMPILER="-w $HC"
57+ - |
58+ if echo $CC | grep -q ghcjs; then
59+ GHCJS=true
60+ HC=${HC}js
61+ WITHCOMPILER="--ghcjs ${WITHCOMPILER}js"
62+ else
63+ GHCJS=false;
64+ fi
65+ - if $GHCJS ; then sudo apt-get install -y ghc-8.6.5 ; fi
66+ - if $GHCJS ; then PATH="/opt/ghc/8.6.5/bin:$PATH" ; fi
67+ - HCPKG="$HC-pkg"
68+ - unset CC
69+ - CABAL=/opt/ghc/bin/cabal
70+ - CABALHOME=$HOME/.cabal
71+ - export PATH="$CABALHOME/bin:$PATH"
72+ - TOP=$(pwd)
73+ - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
74+ - echo $HCNUMVER
75+ - CABAL="$CABAL -vnormal+nowrap+markoutput"
76+ - set -o pipefail
77+ - |
78+ echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk
79+ echo 'BEGIN { state = "output"; }' >> .colorful.awk
80+ echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk
81+ echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk
82+ echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk
83+ echo ' if (state == "cabal") {' >> .colorful.awk
84+ echo ' print blue($0)' >> .colorful.awk
85+ echo ' } else {' >> .colorful.awk
86+ echo ' print $0' >> .colorful.awk
87+ echo ' }' >> .colorful.awk
88+ echo '}' >> .colorful.awk
89+ - cat .colorful.awk
90+ - |
91+ color_cabal_output () {
92+ awk -f $TOP/.colorful.awk
93+ }
94+ - echo text | color_cabal_output
95+install:
96+ - ${CABAL} --version
97+ - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
98+ - node --version
99+ - echo $GHCJS
100+ - TEST=--enable-tests
101+ - BENCH=--enable-benchmarks
102+ - HEADHACKAGE=false
103+ - rm -f $CABALHOME/config
104+ - |
105+ echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
106+ echo "remote-build-reporting: anonymous" >> $CABALHOME/config
107+ echo "write-ghc-environment-files: always" >> $CABALHOME/config
108+ echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
109+ echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
110+ echo "world-file: $CABALHOME/world" >> $CABALHOME/config
111+ echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
112+ echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
113+ echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
114+ echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
115+ echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
116+ echo "install-dirs user" >> $CABALHOME/config
117+ echo " prefix: $CABALHOME" >> $CABALHOME/config
118+ echo "repository hackage.haskell.org" >> $CABALHOME/config
119+ echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
120+ - cat $CABALHOME/config
121+ - rm -fv cabal.project cabal.project.local cabal.project.freeze
122+ - travis_retry ${CABAL} v2-update -v
123+ - if $GHCJS ; then (cd /tmp && ${CABAL} v2-install -w ghc-8.6.5 happy) ; fi
124+ # Generate cabal.project
125+ - rm -rf cabal.project cabal.project.local cabal.project.freeze
126+ - touch cabal.project
127+ - |
128+ echo "packages: ." >> cabal.project
129+ - cat cabal.project || true
130+ - cat cabal.project.local || true
131+ - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
132+ - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
133+ - ${CABAL} v2-configure $WITHCOMPILER ${TEST} ${BENCH} | color_cabal_output
134+ - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
135+ - rm cabal.project.freeze || true
136+ - rm cabal.project.local || true
137+script:
138+ - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
139+ # Packaging...
140+ - ${CABAL} v2-sdist all | color_cabal_output
141+ # Unpacking...
142+ - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
143+ - cd ${DISTDIR} || false
144+ - find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
145+ - find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
146+ - PKGDIR_reflex="$(find . -maxdepth 1 -type d -regex '.*/reflex-[0-9.]*')"
147+ # Generate cabal.project
148+ - rm -rf cabal.project cabal.project.local cabal.project.freeze
149+ - touch cabal.project
150+ - |
151+ echo "packages: ${PKGDIR_reflex}" >> cabal.project
152+ - |
153+ - cat cabal.project || true
154+ - cat cabal.project.local || true
155+ - rm cabal.project.local || true
156+ # Building...
157+ # this builds all libraries and executables (without tests/benchmarks)
158+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
159+ # Building with tests and benchmarks...
160+ # build & run tests, build benchmarks
161+ - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output
162+ # Testing...
163+ - if ! $GHCJS && [ $HCNUMVER -ge 80000 ] && [ $HCNUMVER -lt 80606 ] ; then ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output ; fi
164+ # cabal check...
165+ - (cd ${PKGDIR_reflex} && ${CABAL} -vnormal check)
166+ # haddock...
167+ - if ! $GHCJS && [ $HCNUMVER -ge 80000 ] && [ $HCNUMVER -lt 80606 ] ; then ${CABAL} v2-haddock $WITHCOMPILER ${TEST} ${BENCH} all | color_cabal_output ; fi
168+ # Building without installed constraints for packages in global-db...
169+ - rm -f cabal.project.local || true
170+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all | color_cabal_output
171+ # Constraint sets
172+ - rm -rf cabal.project.local || true
173+ # Constraint set no-th
174+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='reflex -use-template-haskell' all | color_cabal_output
175+ # Constraint sets
176+ - rm -rf cabal.project.local || true
177+ # Constraint set don't use split these/semialign
178+ - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='reflex -split-these' all | color_cabal_output
179+
180+# REGENDATA ["--config=cabal.haskell-ci","cabal.project"]
181+# EOF
182+
ChangeLog.md+6
@@ -1,5 +1,11 @@
1# Revision history for reflex
1# Revision history for reflex
2
2
3+## 0.6.2.2
4+
5+* Support these >= 1. Add `split-these` flag to control whether to use new these/semialign combination or not.
6+* Update version bounds to fix some CI failures
7+* Add travis CI configuration
8+
3## 0.6.2.1
9## 0.6.2.1
4
10
5* Generalize `fan` to `fanG` to take a `DMap` with non-`Identity`
11* Generalize `fan` to `fanG` to take a `DMap` with non-`Identity`
cabal.haskell-cinew file+8
@@ -0,0 +1,8 @@
1+distribution: xenial
2+
3+-- https://github.com/haskell/cabal/issues/6106
4+install-dependencies: False
5+benchmarks: False
6+
7+constraint-set no-th
8+ constraints: reflex -use-template-haskell
cabal.projectnew file+1
@@ -0,0 +1 @@
1+packages: .
default.nix+8−5
@@ -7,11 +7,12 @@
7, transformers-compat, unbounded-delays, prim-uniq
7, transformers-compat, unbounded-delays, prim-uniq
8, data-default, filepath, directory, filemanip, ghcjs-base
8, data-default, filepath, directory, filemanip, ghcjs-base
9, monoidal-containers, witherable
9, monoidal-containers, witherable
10+, semialign ? null, splitThese ? (semialign != null)
10, useTemplateHaskell ? true
11, useTemplateHaskell ? true
11}:
12}:
12mkDerivation {
13mkDerivation {
13 pname = "reflex";
14 pname = "reflex";
14− version = "0.6.2.1";
15+ version = "0.6.2.2";
15 src = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [ ".git" "dist" ])) ./.;
16 src = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [ ".git" "dist" ])) ./.;
16 libraryHaskellDepends = [
17 libraryHaskellDepends = [
17 base bifunctors containers dependent-map dependent-sum
18 base bifunctors containers dependent-map dependent-sum
@@ -27,13 +28,15 @@ mkDerivation {
27 ghcjs-base
28 ghcjs-base
28 ] else []) ++ (if !useTemplateHaskell then [] else [
29 ] else []) ++ (if !useTemplateHaskell then [] else [
29 haskell-src-exts haskell-src-meta
30 haskell-src-exts haskell-src-meta
30− ]);
31+ ]) ++ (if splitThese then [
32+ semialign
33+ ] else []);
31 testHaskellDepends = if ghc.isGhcjs or false then [] else [
34 testHaskellDepends = if ghc.isGhcjs or false then [] else [
32 hlint filepath directory filemanip
35 hlint filepath directory filemanip
33 ];
36 ];
34− configureFlags = if useTemplateHaskell then [] else [
37+ configureFlags =
35− "-f-use-template-haskell"
38+ stdenv.lib.optional (!useTemplateHaskell) [ "-f-use-template-haskell" ] ++
36− ];
39+ stdenv.lib.optional (!splitThese) [ "-f-split-these" ];
37 homepage = "https://github.com/reflex-frp/reflex";
40 homepage = "https://github.com/reflex-frp/reflex";
38 description = "Higher-order Functional Reactive Programming";
41 description = "Higher-order Functional Reactive Programming";
39 license = stdenv.lib.licenses.bsd3;
42 license = stdenv.lib.licenses.bsd3;
reflex.cabal+60−32
@@ -1,5 +1,5 @@
1Name: reflex
1Name: reflex
2−Version: 0.6.2.1
2+Version: 0.6.2.2
3Synopsis: Higher-order Functional Reactive Programming
3Synopsis: Higher-order Functional Reactive Programming
4Description: Reflex is a high-performance, deterministic, higher-order Functional Reactive Programming system
4Description: Reflex is a high-performance, deterministic, higher-order Functional Reactive Programming system
5License: BSD3
5License: BSD3
@@ -17,6 +17,10 @@ extra-source-files:
17 Quickref.md
17 Quickref.md
18 ChangeLog.md
18 ChangeLog.md
19
19
20+tested-with:
21+ GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5,
22+ GHCJS ==8.4
23+
20flag use-reflex-optimizer
24flag use-reflex-optimizer
21 description: Use the GHC plugin Reflex.Optimizer on some of the modules in the package. This is still experimental.
25 description: Use the GHC plugin Reflex.Optimizer on some of the modules in the package. This is still experimental.
22 default: False
26 default: False
@@ -37,39 +41,48 @@ flag fast-weak
37 default: False
41 default: False
38 manual: True
42 manual: True
39
43
44+flag split-these
45+ description: Use split these/semialign packages
46+ manual: False
47+ default: True
48+
40library
49library
41 hs-source-dirs: src
50 hs-source-dirs: src
42 build-depends:
51 build-depends:
43 MemoTrie == 0.6.*,
52 MemoTrie == 0.6.*,
44 base >= 4.9 && < 4.13,
53 base >= 4.9 && < 4.13,
45 bifunctors >= 5.2 && < 5.6,
54 bifunctors >= 5.2 && < 5.6,
46− comonad,
55+ comonad >= 5.0.4 && < 5.1,
47− constraints-extras >= 0.2,
56+ constraints-extras >= 0.3 && < 0.4,
48− containers >= 0.5 && < 0.7,
57+ containers >= 0.6 && < 0.7,
49 data-default >= 0.5 && < 0.8,
58 data-default >= 0.5 && < 0.8,
50 dependent-map >= 0.3 && < 0.4,
59 dependent-map >= 0.3 && < 0.4,
51 exception-transformers == 0.4.*,
60 exception-transformers == 0.4.*,
52− profunctors >= 5.0 && < 6.0,
61+ profunctors >= 5.3 && < 5.5,
53 lens >= 4.7 && < 5,
62 lens >= 4.7 && < 5,
54 monad-control >= 1.0.1 && < 1.1,
63 monad-control >= 1.0.1 && < 1.1,
55− monoidal-containers >= 0.4 && < 0.6,
56 mtl >= 2.1 && < 2.3,
64 mtl >= 2.1 && < 2.3,
57 prim-uniq >= 0.1.0.1 && < 0.2,
65 prim-uniq >= 0.1.0.1 && < 0.2,
58− primitive >= 0.5 && < 0.7,
66+ primitive >= 0.5 && < 0.8,
59 profunctors,
67 profunctors,
60 random == 1.1.*,
68 random == 1.1.*,
61 ref-tf == 0.4.*,
69 ref-tf == 0.4.*,
62 reflection == 2.1.*,
70 reflection == 2.1.*,
63 semigroupoids >= 4.0 && < 6,
71 semigroupoids >= 4.0 && < 6,
64− semigroups >= 0.16 && < 0.19,
65 stm >= 2.4 && < 2.6,
72 stm >= 2.4 && < 2.6,
66 syb >= 0.5 && < 0.8,
73 syb >= 0.5 && < 0.8,
67− these >= 0.4 && < 0.9,
68 time >= 1.4 && < 1.9,
74 time >= 1.4 && < 1.9,
69− transformers >= 0.2,
75+ transformers >= 0.5.6.0 && < 0.6,
70− transformers-compat >= 0.3,
71 unbounded-delays >= 0.1.0.0 && < 0.2,
76 unbounded-delays >= 0.1.0.0 && < 0.2,
72− witherable >= 0.2 && < 0.4
77+ witherable >= 0.2 && < 0.3
78+
79+ if flag(split-these)
80+ build-depends: these >= 1 && <1.1,
81+ semialign >=1 && <1.1,
82+ monoidal-containers >= 0.5.0.1 && < 0.6
83+ else
84+ build-depends: these >= 0.4 && <0.9,
85+ monoidal-containers == 0.5.0.0
73
86
74 exposed-modules:
87 exposed-modules:
75 Control.Monad.ReaderIO
88 Control.Monad.ReaderIO
@@ -146,7 +159,7 @@ library
146 other-extensions: TemplateHaskell
159 other-extensions: TemplateHaskell
147 else
160 else
148 build-depends:
161 build-depends:
149− dependent-sum == 0.6.*
162+ dependent-sum >= 0.6 && < 0.7
150
163
151 if flag(fast-weak) && impl(ghcjs)
164 if flag(fast-weak) && impl(ghcjs)
152 cpp-options: -DGHCJS_FAST_WEAK
165 cpp-options: -DGHCJS_FAST_WEAK
@@ -163,14 +176,14 @@ test-suite semantics
163 base,
176 base,
164 bifunctors,
177 bifunctors,
165 containers,
178 containers,
166− deepseq >= 1.3 && < 1.5,
179+ deepseq,
167 dependent-map,
180 dependent-map,
168 dependent-sum,
181 dependent-sum,
169 mtl,
182 mtl,
170 ref-tf,
183 ref-tf,
171 reflex,
184 reflex,
172 split,
185 split,
173− transformers >= 0.3
186+ transformers
174 other-modules:
187 other-modules:
175 Reflex.Bench.Focused
188 Reflex.Bench.Focused
176 Reflex.Plan.Pure
189 Reflex.Plan.Pure
@@ -189,7 +202,7 @@ test-suite CrossImpl
189 containers,
202 containers,
190 dependent-map,
203 dependent-map,
191 dependent-sum,
204 dependent-sum,
192− deepseq >= 1.3 && < 1.5,
205+ deepseq,
193 mtl,
206 mtl,
194 transformers,
207 transformers,
195 ref-tf,
208 ref-tf,
@@ -208,7 +221,7 @@ test-suite hlint
208 , directory
221 , directory
209 , filepath
222 , filepath
210 , filemanip
223 , filemanip
211− , hlint
224+ , hlint < 2.1 || >= 2.2.2
212 if impl(ghcjs)
225 if impl(ghcjs)
213 buildable: False
226 buildable: False
214
227
@@ -218,7 +231,7 @@ test-suite EventWriterT
218 hs-source-dirs: test
231 hs-source-dirs: test
219 build-depends: base
232 build-depends: base
220 , containers
233 , containers
221− , deepseq >= 1.3 && < 1.5
234+ , deepseq
222 , dependent-map
235 , dependent-map
223 , dependent-sum
236 , dependent-sum
224 , lens
237 , lens
@@ -227,6 +240,10 @@ test-suite EventWriterT
227 , transformers
240 , transformers
228 , reflex
241 , reflex
229 , ref-tf
242 , ref-tf
243+
244+ if flag(split-these)
245+ build-depends: these-lens
246+
230 other-modules:
247 other-modules:
231 Reflex.Test
248 Reflex.Test
232 Reflex.TestPlan
249 Reflex.TestPlan
@@ -234,13 +251,14 @@ test-suite EventWriterT
234 Reflex.Plan.Pure
251 Reflex.Plan.Pure
235 Test.Run
252 Test.Run
236
253
254+
237test-suite RequesterT
255test-suite RequesterT
238 type: exitcode-stdio-1.0
256 type: exitcode-stdio-1.0
239 main-is: RequesterT.hs
257 main-is: RequesterT.hs
240 hs-source-dirs: test
258 hs-source-dirs: test
241 build-depends: base
259 build-depends: base
242 , containers
260 , containers
243− , deepseq >= 1.3 && < 1.5
261+ , deepseq
244 , dependent-sum
262 , dependent-sum
245 , dependent-map
263 , dependent-map
246 , lens
264 , lens
@@ -249,9 +267,14 @@ test-suite RequesterT
249 , transformers
267 , transformers
250 , reflex
268 , reflex
251 , ref-tf
269 , ref-tf
270+
271+ if flag(split-these)
272+ build-depends: these-lens
273+
252 other-modules:
274 other-modules:
253 Reflex.TestPlan
275 Reflex.TestPlan
254 Reflex.Plan.Pure
276 Reflex.Plan.Pure
277+ Test.Run
255
278
256test-suite QueryT
279test-suite QueryT
257 type: exitcode-stdio-1.0
280 type: exitcode-stdio-1.0
@@ -261,15 +284,18 @@ test-suite QueryT
261 , containers
284 , containers
262 , dependent-map
285 , dependent-map
263 , dependent-sum
286 , dependent-sum
264− , deepseq >= 1.3 && < 1.5
287+ , deepseq
265 , lens
288 , lens
266 , monoidal-containers
289 , monoidal-containers
267 , mtl
290 , mtl
268 , ref-tf
291 , ref-tf
269 , reflex
292 , reflex
270− , semigroups
271 , these
293 , these
272 , transformers
294 , transformers
295+
296+ if flag(split-these)
297+ build-depends: semialign, these-lens
298+
273 other-modules:
299 other-modules:
274 Test.Run
300 Test.Run
275 Reflex.TestPlan
301 Reflex.TestPlan
@@ -284,14 +310,16 @@ test-suite GC-Semantics
284 , containers
310 , containers
285 , dependent-sum
311 , dependent-sum
286 , dependent-map
312 , dependent-map
287− , deepseq >= 1.3 && < 1.5
313+ , deepseq
288 , mtl
314 , mtl
289 , these
315 , these
290 , transformers
316 , transformers
291 , reflex
317 , reflex
292 , ref-tf
318 , ref-tf
293− if impl(ghc < 8)
319+
320+ if flag(split-these)
294− build-depends: semigroups
321+ build-depends: semialign
322+
295 other-modules:
323 other-modules:
296 Reflex.Plan.Pure
324 Reflex.Plan.Pure
297 Reflex.Plan.Reflex
325 Reflex.Plan.Reflex
@@ -304,7 +332,7 @@ test-suite rootCleanup
304 hs-source-dirs: test
332 hs-source-dirs: test
305 build-depends: base
333 build-depends: base
306 , containers
334 , containers
307− , deepseq >= 1.3 && < 1.5
335+ , deepseq
308 , dependent-sum
336 , dependent-sum
309 , mtl
337 , mtl
310 , reflex
338 , reflex
@@ -323,8 +351,8 @@ benchmark spider-bench
323 build-depends:
351 build-depends:
324 base,
352 base,
325 containers,
353 containers,
326− criterion >= 1.1 && < 1.6,
354+ criterion,
327− deepseq >= 1.3 && < 1.5,
355+ deepseq,
328 dependent-map,
356 dependent-map,
329 dependent-sum,
357 dependent-sum,
330 ref-tf,
358 ref-tf,
@@ -333,7 +361,7 @@ benchmark spider-bench
333 reflex,
361 reflex,
334 split,
362 split,
335 stm,
363 stm,
336− transformers >= 0.3
364+ transformers
337 other-modules:
365 other-modules:
338 Reflex.TestPlan
366 Reflex.TestPlan
339 Reflex.Plan.Reflex
367 Reflex.Plan.Reflex
@@ -347,9 +375,9 @@ benchmark saulzar-bench
347 ghc-options: -Wall -O2 -rtsopts -threaded
375 ghc-options: -Wall -O2 -rtsopts -threaded
348 build-depends:
376 build-depends:
349 base,
377 base,
350− containers >= 0.5 && < 0.7,
378+ containers,
351− criterion >= 1.1 && < 1.6,
379+ criterion,
352− deepseq >= 1.3 && < 1.5,
380+ deepseq,
353 dependent-map,
381 dependent-map,
354 dependent-sum,
382 dependent-sum,
355 loch-th,
383 loch-th,
@@ -361,7 +389,7 @@ benchmark saulzar-bench
361 split,
389 split,
362 stm,
390 stm,
363 time,
391 time,
364− transformers >= 0.3
392+ transformers
365 other-modules:
393 other-modules:
366 Reflex.TestPlan
394 Reflex.TestPlan
367 Reflex.Plan.Reflex
395 Reflex.Plan.Reflex
release.nix+4−4
@@ -3,7 +3,7 @@
3let
3let
4 inherit (rp.nixpkgs) lib;
4 inherit (rp.nixpkgs) lib;
5 compilers = ["ghc8_4" "ghc8_0" "ghcjs8_4" "ghcjs8_0"];
5 compilers = ["ghc8_4" "ghc8_0" "ghcjs8_4" "ghcjs8_0"];
6−in lib.genAttrs compilers (ghc: {
6+in lib.attrValues (lib.genAttrs compilers (ghc: {
7− reflex-useTemplateHaskell = rp.${ghc}.callPackage ./. { useTemplateHaskell = true; };
7+ reflex-useTemplateHaskell = rp.${ghc}.callPackage ./. { useTemplateHaskell = true; splitThese = false; };
8− reflex = rp.${ghc}.callPackage ./. { useTemplateHaskell = false; };
8+ reflex = rp.${ghc}.callPackage ./. { useTemplateHaskell = false; splitThese = false; };
9−})
9+}))
src/Data/Functor/Misc.hs−1
@@ -4,7 +4,6 @@
4{-# LANGUAGE FlexibleContexts #-}
4{-# LANGUAGE FlexibleContexts #-}
5{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE FlexibleInstances #-}
6{-# LANGUAGE GADTs #-}
6{-# LANGUAGE GADTs #-}
7−{-# LANGUAGE KindSignatures #-}
8{-# LANGUAGE LambdaCase #-}
7{-# LANGUAGE LambdaCase #-}
9{-# LANGUAGE MultiParamTypeClasses #-}
8{-# LANGUAGE MultiParamTypeClasses #-}
10{-# LANGUAGE PatternSynonyms #-}
9{-# LANGUAGE PatternSynonyms #-}
src/Reflex/Adjustable/Class.hs−1
@@ -3,7 +3,6 @@
3{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE FunctionalDependencies #-}
4{-# LANGUAGE FunctionalDependencies #-}
5{-# LANGUAGE LambdaCase #-}
5{-# LANGUAGE LambdaCase #-}
6−{-# LANGUAGE MultiParamTypeClasses #-}
7{-# LANGUAGE RankNTypes #-}
6{-# LANGUAGE RankNTypes #-}
8{-# LANGUAGE ScopedTypeVariables #-}
7{-# LANGUAGE ScopedTypeVariables #-}
9{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeFamilies #-}
src/Reflex/BehaviorWriter/Class.hs−1
@@ -5,7 +5,6 @@ Description: This module defines the 'MonadBehaviorWriter' class
5{-# LANGUAGE CPP #-}
5{-# LANGUAGE CPP #-}
6{-# LANGUAGE FlexibleInstances #-}
6{-# LANGUAGE FlexibleInstances #-}
7{-# LANGUAGE FunctionalDependencies #-}
7{-# LANGUAGE FunctionalDependencies #-}
8−{-# LANGUAGE MultiParamTypeClasses #-}
9{-# LANGUAGE UndecidableInstances #-}
8{-# LANGUAGE UndecidableInstances #-}
10#ifdef USE_REFLEX_OPTIMIZER
9#ifdef USE_REFLEX_OPTIMIZER
11{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
10{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
src/Reflex/Class.hs+12−13
@@ -7,7 +7,6 @@
7{-# LANGUAGE FunctionalDependencies #-}
7{-# LANGUAGE FunctionalDependencies #-}
8{-# LANGUAGE GADTs #-}
8{-# LANGUAGE GADTs #-}
9{-# LANGUAGE LambdaCase #-}
9{-# LANGUAGE LambdaCase #-}
10−{-# LANGUAGE MultiParamTypeClasses #-}
11{-# LANGUAGE NoMonomorphismRestriction #-}
10{-# LANGUAGE NoMonomorphismRestriction #-}
12{-# LANGUAGE PolyKinds #-}
11{-# LANGUAGE PolyKinds #-}
13{-# LANGUAGE RankNTypes #-}
12{-# LANGUAGE RankNTypes #-}
@@ -174,6 +173,14 @@ module Reflex.Class
174 , slowHeadE
173 , slowHeadE
175 ) where
174 ) where
176
175
176+#if defined(MIN_VERSION_semialign)
177+import Prelude hiding (zip, zipWith)
178+
179+#if MIN_VERSION_these(0,8,0)
180+import Data.These.Combinators (justThese)
181+#endif
182+#endif
183+
177import Control.Applicative
184import Control.Applicative
178import Control.Monad.Identity
185import Control.Monad.Identity
179import Control.Monad.Reader
186import Control.Monad.Reader
@@ -680,11 +687,7 @@ instance (Num a, Reflex t) => Num (Dynamic t a) where
680instance (Reflex t, Semigroup a) => Semigroup (Behavior t a) where
687instance (Reflex t, Semigroup a) => Semigroup (Behavior t a) where
681 a <> b = pull $ liftM2 (<>) (sample a) (sample b)
688 a <> b = pull $ liftM2 (<>) (sample a) (sample b)
682 sconcat = pull . fmap sconcat . mapM sample
689 sconcat = pull . fmap sconcat . mapM sample
683−#if MIN_VERSION_semigroups(0,17,0)
684 stimes n = fmap $ stimes n
690 stimes n = fmap $ stimes n
685−#else
686− times1p n = fmap $ times1p n
687−#endif
688
691
689-- | Alias for 'mapMaybe'
692-- | Alias for 'mapMaybe'
690fmapMaybe :: Filterable f => (a -> Maybe b) -> f a -> f b
693fmapMaybe :: Filterable f => (a -> Maybe b) -> f a -> f b
@@ -882,11 +885,7 @@ traceEventWith f = push $ \x -> trace (f x) $ return $ Just x
882instance (Semigroup a, Reflex t) => Semigroup (Event t a) where
885instance (Semigroup a, Reflex t) => Semigroup (Event t a) where
883 (<>) = alignWith (mergeThese (<>))
886 (<>) = alignWith (mergeThese (<>))
884 sconcat = fmap sconcat . mergeList . toList
887 sconcat = fmap sconcat . mergeList . toList
885−#if MIN_VERSION_semigroups(0,17,0)
886 stimes n = fmap $ stimes n
888 stimes n = fmap $ stimes n
887−#else
888− times1p n = fmap $ times1p n
889−#endif
890
889
891instance (Semigroup a, Reflex t) => Monoid (Event t a) where
890instance (Semigroup a, Reflex t) => Monoid (Event t a) where
892 mempty = never
891 mempty = never
@@ -1074,6 +1073,10 @@ instance Reflex t => Align (Event t) where
1074instance Reflex t => Semialign (Event t) where
1073instance Reflex t => Semialign (Event t) where
1075#endif
1074#endif
1076 align = alignEventWithMaybe Just
1075 align = alignEventWithMaybe Just
1076+
1077+#if defined(MIN_VERSION_semialign)
1078+ zip x y = mapMaybe justThese $ align x y
1079+#endif
1077
1080
1078
1081
1079-- | Create a new 'Event' that only occurs if the supplied 'Event' occurs and
1082-- | Create a new 'Event' that only occurs if the supplied 'Event' occurs and
@@ -1115,11 +1118,7 @@ zipDynWith f da db =
1115
1118
1116instance (Reflex t, Semigroup a) => Semigroup (Dynamic t a) where
1119instance (Reflex t, Semigroup a) => Semigroup (Dynamic t a) where
1117 (<>) = zipDynWith (<>)
1120 (<>) = zipDynWith (<>)
1118−#if MIN_VERSION_semigroups(0,17,0)
1119 stimes n = fmap $ stimes n
1121 stimes n = fmap $ stimes n
1120−#else
1121− times1p n = fmap $ times1p n
1122−#endif
1123
1122
1124instance (Reflex t, Monoid a) => Monoid (Dynamic t a) where
1123instance (Reflex t, Monoid a) => Monoid (Dynamic t a) where
1125 mconcat = distributeListOverDynWith mconcat
1124 mconcat = distributeListOverDynWith mconcat
src/Reflex/Collection.hs+4
@@ -27,6 +27,10 @@ module Reflex.Collection
27 , simpleList
27 , simpleList
28 ) where
28 ) where
29
29
30+#if defined(MIN_VERSION_semialign)
31+import Prelude hiding (zip, zipWith)
32+#endif
33+
30import Control.Monad.Identity
34import Control.Monad.Identity
31import Data.Align
35import Data.Align
32import Data.Functor.Misc
36import Data.Functor.Misc
src/Reflex/Dynamic/TH.hs+1−1
@@ -81,7 +81,7 @@ mkDynPure = QuasiQuoter
81 }
81 }
82
82
83mkDynExp :: String -> Q Exp
83mkDynExp :: String -> Q Exp
84−mkDynExp s = case Hs.parseExpWithMode (Hs.defaultParseMode { Hs.extensions = [ Hs.EnableExtension Hs.TemplateHaskell ] }) s of
84+mkDynExp s = case Hs.parseExpWithMode Hs.defaultParseMode { Hs.extensions = [ Hs.EnableExtension Hs.TemplateHaskell ] } s of
85 Hs.ParseFailed (Hs.SrcLoc _ l c) err -> fail $ "mkDyn:" <> show l <> ":" <> show c <> ": " <> err
85 Hs.ParseFailed (Hs.SrcLoc _ l c) err -> fail $ "mkDyn:" <> show l <> ":" <> show c <> ": " <> err
86 Hs.ParseOk e -> qDynPure $ return $ everywhere (id `extT` reinstateUnqDyn) $ Hs.toExp $ everywhere (id `extT` antiE) e
86 Hs.ParseOk e -> qDynPure $ return $ everywhere (id `extT` reinstateUnqDyn) $ Hs.toExp $ everywhere (id `extT` antiE) e
87 where TH.Name (TH.OccName occName) (TH.NameG _ _ (TH.ModName modName)) = 'unqMarker
87 where TH.Name (TH.OccName occName) (TH.NameG _ _ (TH.ModName modName)) = 'unqMarker
src/Reflex/DynamicWriter/Class.hs−1
@@ -3,7 +3,6 @@
3{-# LANGUAGE CPP #-}
3{-# LANGUAGE CPP #-}
4{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE FunctionalDependencies #-}
5{-# LANGUAGE FunctionalDependencies #-}
6−{-# LANGUAGE MultiParamTypeClasses #-}
7{-# LANGUAGE UndecidableInstances #-}
6{-# LANGUAGE UndecidableInstances #-}
8#ifdef USE_REFLEX_OPTIMIZER
7#ifdef USE_REFLEX_OPTIMIZER
9{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
8{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
src/Reflex/EventWriter/Base.hs+1−1
@@ -52,7 +52,7 @@ import qualified Data.Map as Map
52import Data.Semigroup
52import Data.Semigroup
53import Data.Some (Some)
53import Data.Some (Some)
54import Data.Tuple
54import Data.Tuple
55−import Data.Type.Equality hiding (apply)
55+import Data.Type.Equality
56
56
57import Unsafe.Coerce
57import Unsafe.Coerce
58
58
src/Reflex/EventWriter/Class.hs−1
@@ -2,7 +2,6 @@
2{-# LANGUAGE CPP #-}
2{-# LANGUAGE CPP #-}
3{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE FunctionalDependencies #-}
4{-# LANGUAGE FunctionalDependencies #-}
5−{-# LANGUAGE MultiParamTypeClasses #-}
6{-# LANGUAGE UndecidableInstances #-}
5{-# LANGUAGE UndecidableInstances #-}
7#ifdef USE_REFLEX_OPTIMIZER
6#ifdef USE_REFLEX_OPTIMIZER
8{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
7{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
src/Reflex/Host/Class.hs−1
@@ -4,7 +4,6 @@
4{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE FunctionalDependencies #-}
5{-# LANGUAGE FunctionalDependencies #-}
6{-# LANGUAGE GADTs #-}
6{-# LANGUAGE GADTs #-}
7−{-# LANGUAGE MultiParamTypeClasses #-}
8{-# LANGUAGE RankNTypes #-}
7{-# LANGUAGE RankNTypes #-}
9{-# LANGUAGE RoleAnnotations #-}
8{-# LANGUAGE RoleAnnotations #-}
10{-# LANGUAGE ScopedTypeVariables #-}
9{-# LANGUAGE ScopedTypeVariables #-}
src/Reflex/NotReady/Class.hs−1
@@ -3,7 +3,6 @@
3{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE FlexibleContexts #-}
4{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE FunctionalDependencies #-}
5{-# LANGUAGE FunctionalDependencies #-}
6−{-# LANGUAGE MultiParamTypeClasses #-}
7{-# LANGUAGE TypeFamilies #-}
6{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE UndecidableInstances #-}
7{-# LANGUAGE UndecidableInstances #-}
9#ifdef USE_REFLEX_OPTIMIZER
8#ifdef USE_REFLEX_OPTIMIZER
src/Reflex/Patch/IntMap.hs−8
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE DeriveFoldable #-}
1{-# LANGUAGE DeriveFoldable #-}
3{-# LANGUAGE DeriveFunctor #-}
2{-# LANGUAGE DeriveFunctor #-}
4{-# LANGUAGE DeriveTraversable #-}
3{-# LANGUAGE DeriveTraversable #-}
@@ -33,14 +32,7 @@ instance Patch (PatchIntMap a) where
33instance Semigroup (PatchIntMap v) where
32instance Semigroup (PatchIntMap v) where
34 PatchIntMap a <> PatchIntMap b = PatchIntMap $ a `mappend` b --TODO: Add a semigroup instance for Map
33 PatchIntMap a <> PatchIntMap b = PatchIntMap $ a `mappend` b --TODO: Add a semigroup instance for Map
35 -- PatchMap is idempotent, so stimes n is id for every n
34 -- PatchMap is idempotent, so stimes n is id for every n
36−#if MIN_VERSION_semigroups(0,17,0)
37 stimes = stimesIdempotentMonoid
35 stimes = stimesIdempotentMonoid
38−#else
39− times1p n x = case compare n 0 of
40− LT -> error "stimesIdempotentMonoid: negative multiplier"
41− EQ -> mempty
42− GT -> x
43−#endif
44
36
45-- | Map a function @Int -> a -> b@ over all @a@s in the given @'PatchIntMap' a@
37-- | Map a function @Int -> a -> b@ over all @a@s in the given @'PatchIntMap' a@
46-- (that is, all inserts/updates), producing a @PatchIntMap b@.
38-- (that is, all inserts/updates), producing a @PatchIntMap b@.
src/Reflex/Patch/Map.hs−8
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE LambdaCase #-}
1{-# LANGUAGE LambdaCase #-}
3{-# LANGUAGE TypeFamilies #-}
2{-# LANGUAGE TypeFamilies #-}
4-- | 'Patch'es on 'Map' that consist only of insertions (including overwrites)
3-- | 'Patch'es on 'Map' that consist only of insertions (including overwrites)
@@ -35,14 +34,7 @@ instance Ord k => Patch (PatchMap k v) where
35instance Ord k => Semigroup (PatchMap k v) where
34instance Ord k => Semigroup (PatchMap k v) where
36 PatchMap a <> PatchMap b = PatchMap $ a `mappend` b --TODO: Add a semigroup instance for Map
35 PatchMap a <> PatchMap b = PatchMap $ a `mappend` b --TODO: Add a semigroup instance for Map
37 -- PatchMap is idempotent, so stimes n is id for every n
36 -- PatchMap is idempotent, so stimes n is id for every n
38−#if MIN_VERSION_semigroups(0,17,0)
39 stimes = stimesIdempotentMonoid
37 stimes = stimesIdempotentMonoid
40−#else
41− times1p n x = case compare n 0 of
42− LT -> error "stimesIdempotentMonoid: negative multiplier"
43− EQ -> mempty
44− GT -> x
45−#endif
46
38
47-- | The empty 'PatchMap' contains no insertions or deletions
39-- | The empty 'PatchMap' contains no insertions or deletions
48instance Ord k => Monoid (PatchMap k v) where
40instance Ord k => Monoid (PatchMap k v) where
src/Reflex/PerformEvent/Base.hs+1−1
@@ -141,7 +141,7 @@ hostPerformEventT a = do
141 case mToPerform of
141 case mToPerform of
142 Nothing -> return [result']
142 Nothing -> return [result']
143 Just toPerform -> do
143 Just toPerform -> do
144− responses <- runHostFrame $ traverseRequesterData (\v -> Identity <$> v) toPerform
144+ responses <- runHostFrame $ traverseRequesterData (Identity <$>) toPerform
145 mrt <- readRef responseTrigger
145 mrt <- readRef responseTrigger
146 let followupEventTriggers = case mrt of
146 let followupEventTriggers = case mrt of
147 Just rt -> [rt :=> Identity responses]
147 Just rt -> [rt :=> Identity responses]
src/Reflex/PerformEvent/Class.hs−1
@@ -5,7 +5,6 @@
5{-# LANGUAGE FlexibleContexts #-}
5{-# LANGUAGE FlexibleContexts #-}
6{-# LANGUAGE FlexibleInstances #-}
6{-# LANGUAGE FlexibleInstances #-}
7{-# LANGUAGE FunctionalDependencies #-}
7{-# LANGUAGE FunctionalDependencies #-}
8−{-# LANGUAGE MultiParamTypeClasses #-}
9{-# LANGUAGE RankNTypes #-}
8{-# LANGUAGE RankNTypes #-}
10{-# LANGUAGE ScopedTypeVariables #-}
9{-# LANGUAGE ScopedTypeVariables #-}
11{-# LANGUAGE TypeFamilies #-}
10{-# LANGUAGE TypeFamilies #-}
src/Reflex/PostBuild/Class.hs−1
@@ -4,7 +4,6 @@
4{-# LANGUAGE DataKinds #-}
4{-# LANGUAGE DataKinds #-}
5{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE FlexibleInstances #-}
6{-# LANGUAGE FunctionalDependencies #-}
6{-# LANGUAGE FunctionalDependencies #-}
7−{-# LANGUAGE MultiParamTypeClasses #-}
8{-# LANGUAGE ScopedTypeVariables #-}
7{-# LANGUAGE ScopedTypeVariables #-}
9{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeFamilies #-}
10{-# LANGUAGE TypeOperators #-}
9{-# LANGUAGE TypeOperators #-}
src/Reflex/Profiled.hs+3−3
@@ -80,9 +80,9 @@ getCostCentreStack = go []
80 go (cc : l) parent
80 go (cc : l) parent
81
81
82toCostCentreTree :: Ptr CostCentreStack -> Int -> IO CostCentreTree
82toCostCentreTree :: Ptr CostCentreStack -> Int -> IO CostCentreTree
83−toCostCentreTree ccs n = do
83+toCostCentreTree ccs n =
84− ccList <- getCostCentreStack ccs
85− return $ foldr (\cc child -> CostCentreTree 0 n $ Map.singleton cc child) (CostCentreTree n n mempty) ccList
84+ foldr (\cc child -> CostCentreTree 0 n $ Map.singleton cc child) (CostCentreTree n n mempty)
85+ <$> getCostCentreStack ccs
86
86
87getCostCentreTree :: IO CostCentreTree
87getCostCentreTree :: IO CostCentreTree
88getCostCentreTree = do
88getCostCentreTree = do
src/Reflex/Pure.hs−5
@@ -31,14 +31,9 @@ module Reflex.Pure
31 , Incremental (..)
31 , Incremental (..)
32 ) where
32 ) where
33
33
34−#if !MIN_VERSION_base(4,8,0)
35−import Control.Applicative
36−#endif
37−
38import Control.Monad
34import Control.Monad
39import Data.Dependent.Map (DMap, GCompare)
35import Data.Dependent.Map (DMap, GCompare)
40import qualified Data.Dependent.Map as DMap
36import qualified Data.Dependent.Map as DMap
41−import Data.Functor.Identity
42import Data.IntMap (IntMap)
37import Data.IntMap (IntMap)
43import qualified Data.IntMap as IntMap
38import qualified Data.IntMap as IntMap
44import Data.Maybe
39import Data.Maybe
src/Reflex/Query/Base.hs−1
@@ -1,7 +1,6 @@
1{-# LANGUAGE FlexibleInstances #-}
1{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3{-# LANGUAGE InstanceSigs #-}
3{-# LANGUAGE InstanceSigs #-}
4−{-# LANGUAGE KindSignatures #-}
5{-# LANGUAGE LambdaCase #-}
4{-# LANGUAGE LambdaCase #-}
6{-# LANGUAGE MultiParamTypeClasses #-}
5{-# LANGUAGE MultiParamTypeClasses #-}
7{-# LANGUAGE RankNTypes #-}
6{-# LANGUAGE RankNTypes #-}
src/Reflex/Query/Class.hs−1
@@ -3,7 +3,6 @@
3{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE FunctionalDependencies #-}
4{-# LANGUAGE FunctionalDependencies #-}
5{-# LANGUAGE GeneralizedNewtypeDeriving #-}
5{-# LANGUAGE GeneralizedNewtypeDeriving #-}
6−{-# LANGUAGE MultiParamTypeClasses #-}
7{-# LANGUAGE TypeFamilies #-}
6{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE UndecidableInstances #-}
7{-# LANGUAGE UndecidableInstances #-}
9-- |
8-- |
src/Reflex/Requester/Class.hs−1
@@ -6,7 +6,6 @@
6{-# LANGUAGE CPP #-}
6{-# LANGUAGE CPP #-}
7{-# LANGUAGE FlexibleInstances #-}
7{-# LANGUAGE FlexibleInstances #-}
8{-# LANGUAGE FunctionalDependencies #-}
8{-# LANGUAGE FunctionalDependencies #-}
9−{-# LANGUAGE MultiParamTypeClasses #-}
10{-# LANGUAGE RecursiveDo #-}
9{-# LANGUAGE RecursiveDo #-}
11{-# LANGUAGE TypeFamilies #-}
10{-# LANGUAGE TypeFamilies #-}
12{-# LANGUAGE UndecidableInstances #-}
11{-# LANGUAGE UndecidableInstances #-}
src/Reflex/Spider/Internal.hs+12−3
@@ -9,7 +9,6 @@
9{-# LANGUAGE GADTs #-}
9{-# LANGUAGE GADTs #-}
10{-# LANGUAGE GeneralizedNewtypeDeriving #-}
10{-# LANGUAGE GeneralizedNewtypeDeriving #-}
11{-# LANGUAGE LambdaCase #-}
11{-# LANGUAGE LambdaCase #-}
12−{-# LANGUAGE MultiParamTypeClasses #-}
13{-# LANGUAGE MultiWayIf #-}
12{-# LANGUAGE MultiWayIf #-}
14{-# LANGUAGE RankNTypes #-}
13{-# LANGUAGE RankNTypes #-}
15{-# LANGUAGE RoleAnnotations #-}
14{-# LANGUAGE RoleAnnotations #-}
@@ -73,6 +72,12 @@ import System.IO.Unsafe
73import System.Mem.Weak
72import System.Mem.Weak
74import Unsafe.Coerce
73import Unsafe.Coerce
75
74
75+#if defined(MIN_VERSION_semialign)
76+#if MIN_VERSION_these(0,8,0)
77+import Data.These.Combinators (justThese)
78+#endif
79+#endif
80+
76#ifdef DEBUG_CYCLES
81#ifdef DEBUG_CYCLES
77import Control.Monad.State hiding (forM, forM_, mapM, mapM_, sequence)
82import Control.Monad.State hiding (forM, forM_, mapM, mapM_, sequence)
78import Data.List.NonEmpty (NonEmpty (..), nonEmpty)
83import Data.List.NonEmpty (NonEmpty (..), nonEmpty)
@@ -1158,6 +1163,10 @@ instance HasSpiderTimeline x => Semialign (Event x) where
1158 align ea eb = mapMaybe dmapToThese $ mergeG coerce $ dynamicConst $
1163 align ea eb = mapMaybe dmapToThese $ mergeG coerce $ dynamicConst $
1159 DMap.fromDistinctAscList [LeftTag :=> ea, RightTag :=> eb]
1164 DMap.fromDistinctAscList [LeftTag :=> ea, RightTag :=> eb]
1160
1165
1166+#if defined(MIN_VERSION_semialign)
1167+ zip x y = mapMaybe justThese $ align x y
1168+#endif
1169+
1161data DynType x p = UnsafeDyn !(BehaviorM x (PatchTarget p), Event x p)
1170data DynType x p = UnsafeDyn !(BehaviorM x (PatchTarget p), Event x p)
1162 | BuildDyn !(EventM x (PatchTarget p), Event x p)
1171 | BuildDyn !(EventM x (PatchTarget p), Event x p)
1163 | HoldDyn !(Hold x p)
1172 | HoldDyn !(Hold x p)
@@ -1761,7 +1770,7 @@ mergeCheap nt = mergeGCheap' getInitialSubscribers updateMe destroy
1761 let s = subscriber $ return k
1770 let s = subscriber $ return k
1762 (subscription@(EventSubscription _ parentSubd), parentOcc) <- subscribeAndRead (nt e) s
1771 (subscription@(EventSubscription _ parentSubd), parentOcc) <- subscribeAndRead (nt e) s
1763 height <- liftIO $ getEventSubscribedHeight parentSubd
1772 height <- liftIO $ getEventSubscribedHeight parentSubd
1764− return (fmap (\x -> k :=> x) parentOcc, height, k :=> MergeSubscribedParent subscription)
1773+ return (fmap (k :=>) parentOcc, height, k :=> MergeSubscribedParent subscription)
1765 return ( DMap.fromDistinctAscList $ mapMaybe (\(x, _, _) -> x) subscribers
1774 return ( DMap.fromDistinctAscList $ mapMaybe (\(x, _, _) -> x) subscribers
1766 , fmap (\(_, h, _) -> h) subscribers --TODO: Assert that there's no invalidHeight in here
1775 , fmap (\(_, h, _) -> h) subscribers --TODO: Assert that there's no invalidHeight in here
1767 , DMap.fromDistinctAscList $ map (\(_, _, x) -> x) subscribers
1776 , DMap.fromDistinctAscList $ map (\(_, _, x) -> x) subscribers
@@ -1809,7 +1818,7 @@ mergeCheapWithMove nt = mergeGCheap' getInitialSubscribers updateMe destroy
1809 let s = subscriber $ liftIO $ readIORef keyRef
1818 let s = subscriber $ liftIO $ readIORef keyRef
1810 (subscription@(EventSubscription _ parentSubd), parentOcc) <- subscribeAndRead (nt e) s
1819 (subscription@(EventSubscription _ parentSubd), parentOcc) <- subscribeAndRead (nt e) s
1811 height <- liftIO $ getEventSubscribedHeight parentSubd
1820 height <- liftIO $ getEventSubscribedHeight parentSubd
1812− return (fmap (\x -> k :=> x) parentOcc, height, k :=> MergeSubscribedParentWithMove subscription keyRef)
1821+ return (fmap (k :=>) parentOcc, height, k :=> MergeSubscribedParentWithMove subscription keyRef)
1813 return ( DMap.fromDistinctAscList $ mapMaybe (\(x, _, _) -> x) subscribers
1822 return ( DMap.fromDistinctAscList $ mapMaybe (\(x, _, _) -> x) subscribers
1814 , fmap (\(_, h, _) -> h) subscribers --TODO: Assert that there's no invalidHeight in here
1823 , fmap (\(_, h, _) -> h) subscribers --TODO: Assert that there's no invalidHeight in here
1815 , DMap.fromDistinctAscList $ map (\(_, _, x) -> x) subscribers
1824 , DMap.fromDistinctAscList $ map (\(_, _, x) -> x) subscribers
src/Reflex/TriggerEvent/Class.hs−1
@@ -2,7 +2,6 @@
2-- new 'Event's that can be triggered from 'IO'.
2-- new 'Event's that can be triggered from 'IO'.
3{-# LANGUAGE FlexibleInstances #-}
3{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE FunctionalDependencies #-}
4{-# LANGUAGE FunctionalDependencies #-}
5−{-# LANGUAGE MultiParamTypeClasses #-}
6{-# LANGUAGE UndecidableInstances #-}
5{-# LANGUAGE UndecidableInstances #-}
7module Reflex.TriggerEvent.Class
6module Reflex.TriggerEvent.Class
8 ( TriggerEvent (..)
7 ( TriggerEvent (..)
test/EventWriterT.hs+6−4
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE BangPatterns #-}
2{-# LANGUAGE BangPatterns #-}
2{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE GADTs #-}
4{-# LANGUAGE GADTs #-}
@@ -13,6 +14,10 @@ import Data.Functor.Misc
13import qualified Data.Map as M
14import qualified Data.Map as M
14import Data.These
15import Data.These
15
16
17+#if defined(MIN_VERSION_these_lens) || (MIN_VERSION_these(0,8,0) && !MIN_VERSION_these(0,9,0))
18+import Data.These.Lens
19+#endif
20+
16import Reflex
21import Reflex
17import Reflex.EventWriter.Base
22import Reflex.EventWriter.Base
18import Test.Run
23import Test.Run
@@ -48,16 +53,13 @@ unwrapApp x appIn = do
48 return e
53 return e
49
54
50testOrdering :: (Reflex t, Monad m) => Event t () -> EventWriterT t [Int] m ()
55testOrdering :: (Reflex t, Monad m) => Event t () -> EventWriterT t [Int] m ()
51−testOrdering pulse = do
52− forM_ [10,9..1] $ \i -> tellEvent ([i] <$ pulse)
56+testOrdering pulse = forM_ [10,9..1] $ \i -> tellEvent ([i] <$ pulse)
53− return ()
54
57
55testSimultaneous :: (Reflex t, Adjustable t m, MonadHold t m) => Event t (These () ()) -> EventWriterT t [Int] m ()
58testSimultaneous :: (Reflex t, Adjustable t m, MonadHold t m) => Event t (These () ()) -> EventWriterT t [Int] m ()
56testSimultaneous pulse = do
59testSimultaneous pulse = do
57 let e0 = fmapMaybe (^? here) pulse
60 let e0 = fmapMaybe (^? here) pulse
58 e1 = fmapMaybe (^? there) pulse
61 e1 = fmapMaybe (^? there) pulse
59 forM_ [1,3..9] $ \i -> runWithReplace (tellEvent ([i] <$ e0)) $ ffor e1 $ \_ -> tellEvent ([i+1] <$ e0)
62 forM_ [1,3..9] $ \i -> runWithReplace (tellEvent ([i] <$ e0)) $ ffor e1 $ \_ -> tellEvent ([i+1] <$ e0)
60− return ()
61
63
62-- | Test that a widget telling and event which fires at the same time it has been replaced
64-- | Test that a widget telling and event which fires at the same time it has been replaced
63-- doesn't count along with the new widget.
65-- doesn't count along with the new widget.
test/QueryT.hs+4
@@ -19,6 +19,10 @@ import Data.Map.Monoidal (MonoidalMap)
19import Data.Semigroup
19import Data.Semigroup
20import Data.These
20import Data.These
21
21
22+#if defined(MIN_VERSION_these_lens) || (MIN_VERSION_these(0,8,0) && !MIN_VERSION_these(0,9,0))
23+import Data.These.Lens
24+#endif
25+
22import Reflex
26import Reflex
23import Reflex.Patch.MapWithMove
27import Reflex.Patch.MapWithMove
24import Test.Run
28import Test.Run
test/RequesterT.hs+5
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE BangPatterns #-}
2{-# LANGUAGE BangPatterns #-}
2{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE FlexibleContexts #-}
3{-# LANGUAGE GADTs #-}
4{-# LANGUAGE GADTs #-}
@@ -15,6 +16,10 @@ import Data.Functor.Misc
15import qualified Data.Map as M
16import qualified Data.Map as M
16import Data.These
17import Data.These
17
18
19+#if defined(MIN_VERSION_these_lens) || (MIN_VERSION_these(0,8,0) && !MIN_VERSION_these(0,9,0))
20+import Data.These.Lens
21+#endif
22+
18import Reflex
23import Reflex
19import Reflex.Requester.Base
24import Reflex.Requester.Base
20import Reflex.Requester.Class
25import Reflex.Requester.Class
test/hlint.hs+1
@@ -22,6 +22,7 @@ main = do
22 , "--ignore=Use unless"
22 , "--ignore=Use unless"
23 , "--ignore=Reduce duplication"
23 , "--ignore=Reduce duplication"
24 , "--cpp-define=USE_TEMPLATE_HASKELL"
24 , "--cpp-define=USE_TEMPLATE_HASKELL"
25+ , "--ignore=Use tuple-section"
25 ]
26 ]
26 recurseInto = and <$> sequence
27 recurseInto = and <$> sequence
27 [ fileType ==? Directory
28 [ fileType ==? Directory