on develop help sign in
Merge remote-tracking branch 'origin/develop' into requester-simple-fix-nonempty-deferred
c6982fbJoe Betz
.travis.yml+3−1
@@ -29,6 +29,8 @@ matrix:
29 include:
29 include:
30 - compiler: ghcjs-8.4
30 - compiler: ghcjs-8.4
31 addons: {"apt":{"sources":["hvr-ghc"],"packages":["cabal-install-3.0"]}}
31 addons: {"apt":{"sources":["hvr-ghc"],"packages":["cabal-install-3.0"]}}
32+ - compiler: ghc-8.8.1
33+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}}
32 - compiler: ghc-8.6.5
34 - compiler: ghc-8.6.5
33 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}
35 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}
34 - compiler: ghc-8.4.4
36 - compiler: ghc-8.4.4
@@ -163,7 +165,7 @@ script:
163 # Constraint set no-th
165 # Constraint set no-th
164 - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='reflex -use-template-haskell' all | color_cabal_output
166 - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='reflex -use-template-haskell' all | color_cabal_output
165 # Constraint set old-these
167 # Constraint set old-these
166− - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='these <1' all | color_cabal_output
168+ - if $GHCJS || ! $GHCJS && [ $HCNUMVER -lt 80800 ] ; then ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='these <1' all | color_cabal_output ; fi
167 # Constraint set old-witherable
169 # Constraint set old-witherable
168 - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='witherable <0.3.2' all | color_cabal_output
170 - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='witherable <0.3.2' all | color_cabal_output
169
171
ChangeLog.md+24−8
@@ -1,12 +1,16 @@
1# Revision history for reflex
1# Revision history for reflex
2
2
3−## Unreleased
3+## 0.6.3
4+
5+* `Data.WeakBag.traverse` and `Data.FastWeakBag.traverse` have been deprecated.
6+ They are replaced with `Data.WeakBag.traverse_` and `Data.FastWeakBag.traverse_`, respectively.
4
7
5−* Data.WeakBag.traverse and Data.FastWeakBag.traverse have been
6− renamed to Data.WeakBag.traverse_ and Data.FastWeakBag.traverse_
7− respectively.
8* Fixes a bug in `Reflex.Patch.MapWithMove.patchThatSortsMapWith` that was producing invalid `PatchMapWithMove`.
8* Fixes a bug in `Reflex.Patch.MapWithMove.patchThatSortsMapWith` that was producing invalid `PatchMapWithMove`.
9
9
10+* Add missing `NotReady` instances:
11+ - `instance NotReady (SpiderTimeline x) (SpiderHost x)`
12+ - `instance HasSpiderTimeline x => NotReady (SpiderTimeline x) (PerformEventT (SpiderTimeline x) (SpiderHost x))`
13+
10## 0.6.2.4
14## 0.6.2.4
11
15
12* Update to monoidal-containers 0.6
16* Update to monoidal-containers 0.6
@@ -18,7 +22,9 @@
18## 0.6.2.2
22## 0.6.2.2
19
23
20* Support these >= 1. Add `split-these` flag to control whether to use new these/semialign combination or not.
24* Support these >= 1. Add `split-these` flag to control whether to use new these/semialign combination or not.
25+
21* Update version bounds to fix some CI failures
26* Update version bounds to fix some CI failures
27+
22* Add travis CI configuration
28* Add travis CI configuration
23
29
24## 0.6.2.1
30## 0.6.2.1
@@ -33,32 +39,42 @@
33 * Add incrementalCoercion/coerceIncremental to go with dynamicCoercion/coerceDynamic
39 * Add incrementalCoercion/coerceIncremental to go with dynamicCoercion/coerceDynamic
34
40
35* Generalize merging functions:
41* Generalize merging functions:
36− `merge` to `mergeG`,
42+ `merge` to `mergeG`,
37− `mergeIncremental` to `mergeIncrementalG`,
43+ `mergeIncremental` to `mergeIncrementalG`,
38− `mergeIncrementalWithMove` to `mergeIncrementalWithMoveG`.
44+ `mergeIncrementalWithMove` to `mergeIncrementalWithMoveG`.
39
45
40* Generalize distribute function:
46* Generalize distribute function:
41 `distributeDMapOverDynPure` to `distributeDMapOverDynPureG`,
47 `distributeDMapOverDynPure` to `distributeDMapOverDynPureG`,
42
48
43## 0.6.2.0
49## 0.6.2.0
44
50
45−* Fix `holdDyn` so that it is lazy in its event argument
51+* Fix `holdDyn` so that it is lazy in its event argument
46 These produce `DMap`s whose values needn't be `Identity`.
52 These produce `DMap`s whose values needn't be `Identity`.
53+
47* Stop using the now-deprecated `*Tag` classes (e.g., `ShowTag`).
54* Stop using the now-deprecated `*Tag` classes (e.g., `ShowTag`).
55+
48* Fix `holdDyn` so that it is lazy in its event argument.
56* Fix `holdDyn` so that it is lazy in its event argument.
49
57
50## 0.6.1.0
58## 0.6.1.0
51
59
52* Re-export all of `Data.Map.Monoidal`
60* Re-export all of `Data.Map.Monoidal`
61+
53* Fix `QueryT` and `RequesterT` tests
62* Fix `QueryT` and `RequesterT` tests
54
63
55## 0.6.0.0 -- 2019-03-20
64## 0.6.0.0 -- 2019-03-20
56
65
57* Deprecate `FunctorMaybe` in favor of `Data.Witherable.Filterable`. We still export `fmapMaybe`, `ffilter`, etc., but they all rely on `Filterable` now.
66* Deprecate `FunctorMaybe` in favor of `Data.Witherable.Filterable`. We still export `fmapMaybe`, `ffilter`, etc., but they all rely on `Filterable` now.
67+
58* Rename `MonadDynamicWriter` to `DynamicWriter` and add a deprecation for the old name.
68* Rename `MonadDynamicWriter` to `DynamicWriter` and add a deprecation for the old name.
69+
59* Remove many deprecated functions.
70* Remove many deprecated functions.
71+
60* Add a `Num` instance for `Dynamic`.
72* Add a `Num` instance for `Dynamic`.
73+
61* Add `matchRequestsWithResponses` to make it easier to use `Requester` with protocols that don't do this matching for you.
74* Add `matchRequestsWithResponses` to make it easier to use `Requester` with protocols that don't do this matching for you.
75+
62* Add `withRequesterT` to map functions over the request and response of a `RequesterT`.
76* Add `withRequesterT` to map functions over the request and response of a `RequesterT`.
77+
63* Suppress nil patches in `QueryT` as an optimization. The `Query` type must now have an `Eq` instance.
78* Suppress nil patches in `QueryT` as an optimization. The `Query` type must now have an `Eq` instance.
79+
64* Add `throttleBatchWithLag` to `Reflex.Time`. See that module for details.
80* Add `throttleBatchWithLag` to `Reflex.Time`. See that module for details.
Quickref.md+14−11
@@ -198,7 +198,7 @@ For Events, the returned Event fires whenever the latest Event supplied by the w
198The functions mentioned above are used to create a static FRP network.
198The functions mentioned above are used to create a static FRP network.
199There are additional typeclasses that can be used to modify the FRP network, to have it interact with IO action, or to introspect the building of the network.
199There are additional typeclasses that can be used to modify the FRP network, to have it interact with IO action, or to introspect the building of the network.
200
200
201−Th typeclasses and their associated annotations include:
201+The typeclasses and their associated annotations include:
202
202
203- `PostBuild`
203- `PostBuild`
204 Fire an Event when an FRP network has been set up.
204 Fire an Event when an FRP network has been set up.
@@ -206,7 +206,7 @@ Th typeclasses and their associated annotations include:
206 [B] -- Function runs in any monad supporting PostBuild
206 [B] -- Function runs in any monad supporting PostBuild
207 ```
207 ```
208
208
209−- `Adjustable`
209+- `Adjustable`
210 Use Events to add or remove pieces of an FRP network.
210 Use Events to add or remove pieces of an FRP network.
211 ```haskell
211 ```haskell
212 [A] -- Function runs in any monad supporting Adjustable
212 [A] -- Function runs in any monad supporting Adjustable
@@ -271,7 +271,7 @@ Th typeclasses and their associated annotations include:
271```haskell
271```haskell
272-- Run side-effecting actions in Event when it occurs; returned Event contains
272-- Run side-effecting actions in Event when it occurs; returned Event contains
273-- results. Side effects run in the (Performable m) monad which is associated with
273-- results. Side effects run in the (Performable m) monad which is associated with
274−-- the (PerformEvent t m) typeclass constraint.
274+-- the (PerformEvent t m) typeclass constraint.
275-- This allows for working with IO when a ((MonadIO (Performable m)) constraint is available.
275-- This allows for working with IO when a ((MonadIO (Performable m)) constraint is available.
276[P] performEvent :: Event (Performable m a ) -> m (Event a)
276[P] performEvent :: Event (Performable m a ) -> m (Event a)
277
277
@@ -295,17 +295,20 @@ Th typeclasses and their associated annotations include:
295## Networks
295## Networks
296
296
297```haskell
297```haskell
298−-- Functions from Reflex.Network used to deal with Dynamics/Events carrying (m a)
298+-- Functions from Reflex.Adjustable / Reflex.Network used to deal with Dynamics/Events carrying (m a)
299
299
300+[A] runWithReplace :: m a -> Event t (m b) -> m (a, Event t b)
301+
300−-- Given a Dynamic of network-creating actions, create a network that is recreated whenever the Dynamic updates.
302+-- Given a Dynamic of network-creating actions, create a network that is recreated whenever the Dynamic updates.
301−-- The returned Event of network results occurs when the Dynamic does. Note: Often, the type a is an Event,
303+-- The returned Event of network results occurs when the Dynamic does. Note: Often, the type a is an Event,
302-- in which case the return value is an Event-of-Events that would typically be flattened (via switchHold).
304-- in which case the return value is an Event-of-Events that would typically be flattened (via switchHold).
303−[P,A] networkView :: Dynamic (m a) -> m (Event a)
305+[P,A] networkView :: Dynamic (m a) -> m (Event a)
304
306
305−-- Given an initial network and an Event of network-creating actions, create a network that is recreated whenever the
307+-- Given an initial network and an Event of network-creating actions, create a network that is recreated whenever the
306−-- Event fires. The returned Dynamic of network results occurs when the Event does. Note: Often, the type a is an
308+-- Event fires. The returned Dynamic of network results occurs when the Event does. Note: Often, the type a is an
307-- Event, in which case the return value is a Dynamic-of-Events that would typically be flattened.
309-- Event, in which case the return value is a Dynamic-of-Events that would typically be flattened.
308−[H,A] networkHold :: m a -> Event (m a) -> m (Dynamic a)
310+[H,A] networkHold :: m a -> Event (m a) -> m (Dynamic a)
309
311
310-- Render a placeholder network to be shown while another network is not yet done building
312-- Render a placeholder network to be shown while another network is not yet done building
311−[P,A] untilReady :: m a -> m b -> m (a, Event b)
313+[P,A] untilReady :: m a -> m b -> m (a, Event b)
314+```
cabal.haskell-ci+1
@@ -10,6 +10,7 @@ constraint-set no-th
10 constraints: reflex -use-template-haskell
10 constraints: reflex -use-template-haskell
11
11
12constraint-set old-these
12constraint-set old-these
13+ ghc: <8.8
13 constraints: these <1
14 constraints: these <1
14
15
15constraint-set old-witherable
16constraint-set old-witherable
dep/reflex-platform/github.json+3−3
@@ -1,7 +1,7 @@
1{
1{
2 "owner": "reflex-frp",
2 "owner": "reflex-frp",
3 "repo": "reflex-platform",
3 "repo": "reflex-platform",
4− "branch": "jailbreakTheselens",
4+ "branch": "develop",
5− "rev": "4284ed527c96c373538dc7e31776d9a50ca6aa91",
5+ "rev": "e7b76dd552a10916c7d8702c11292dac4f4299ea",
6− "sha256": "1m1nkxq7ng9wnqbd77xn8d81f2iz8g61y5m0r3gp0gi0q59jm8ay"
6+ "sha256": "0s1183arrwldcs50qhzgnv94v24n9bgq6dfq64wp0a3q2nzyvgwh"
7}
7}
reflex.cabal+7−8
@@ -1,5 +1,5 @@
1Name: reflex
1Name: reflex
2−Version: 0.6.2.4
2+Version: 0.6.3
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
@@ -18,7 +18,7 @@ extra-source-files:
18 ChangeLog.md
18 ChangeLog.md
19
19
20tested-with:
20tested-with:
21− GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5,
21+ GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.1,
22 GHCJS ==8.4
22 GHCJS ==8.4
23
23
24flag use-reflex-optimizer
24flag use-reflex-optimizer
@@ -50,7 +50,7 @@ library
50 hs-source-dirs: src
50 hs-source-dirs: src
51 build-depends:
51 build-depends:
52 MemoTrie == 0.6.*,
52 MemoTrie == 0.6.*,
53− base >= 4.9 && < 4.13,
53+ base >= 4.9 && < 4.14,
54 bifunctors >= 5.2 && < 5.6,
54 bifunctors >= 5.2 && < 5.6,
55 comonad >= 5.0.4 && < 5.1,
55 comonad >= 5.0.4 && < 5.1,
56 constraints-extras >= 0.3 && < 0.4,
56 constraints-extras >= 0.3 && < 0.4,
@@ -59,20 +59,19 @@ library
59 dependent-map >= 0.3 && < 0.4,
59 dependent-map >= 0.3 && < 0.4,
60 dlist == 0.8.*,
60 dlist == 0.8.*,
61 exception-transformers == 0.4.*,
61 exception-transformers == 0.4.*,
62− profunctors >= 5.3 && < 5.5,
63 lens >= 4.7 && < 5,
62 lens >= 4.7 && < 5,
64 monad-control >= 1.0.1 && < 1.1,
63 monad-control >= 1.0.1 && < 1.1,
65 mtl >= 2.1 && < 2.3,
64 mtl >= 2.1 && < 2.3,
66 prim-uniq >= 0.1.0.1 && < 0.2,
65 prim-uniq >= 0.1.0.1 && < 0.2,
67 primitive >= 0.5 && < 0.8,
66 primitive >= 0.5 && < 0.8,
68− profunctors,
67+ profunctors >= 5.3 && < 5.6,
69 random == 1.1.*,
68 random == 1.1.*,
70 ref-tf == 0.4.*,
69 ref-tf == 0.4.*,
71 reflection == 2.1.*,
70 reflection == 2.1.*,
72 semigroupoids >= 4.0 && < 6,
71 semigroupoids >= 4.0 && < 6,
73 stm >= 2.4 && < 2.6,
72 stm >= 2.4 && < 2.6,
74 syb >= 0.5 && < 0.8,
73 syb >= 0.5 && < 0.8,
75− time >= 1.4 && < 1.9,
74+ time >= 1.4 && < 1.10,
76 transformers >= 0.5.6.0 && < 0.6,
75 transformers >= 0.5.6.0 && < 0.6,
77 unbounded-delays >= 0.1.0.0 && < 0.2,
76 unbounded-delays >= 0.1.0.0 && < 0.2,
78 witherable >= 0.3 && < 0.3.2
77 witherable >= 0.3 && < 0.3.2
@@ -161,9 +160,9 @@ library
161 cpp-options: -DUSE_TEMPLATE_HASKELL
160 cpp-options: -DUSE_TEMPLATE_HASKELL
162 build-depends:
161 build-depends:
163 dependent-sum >= 0.6 && < 0.7,
162 dependent-sum >= 0.6 && < 0.7,
164− haskell-src-exts >= 1.16 && < 1.22,
163+ haskell-src-exts >= 1.16 && < 1.23,
165 haskell-src-meta >= 0.6 && < 0.9,
164 haskell-src-meta >= 0.6 && < 0.9,
166− template-haskell >= 2.9 && < 2.15
165+ template-haskell >= 2.9 && < 2.16
167 exposed-modules:
166 exposed-modules:
168 Reflex.Dynamic.TH
167 Reflex.Dynamic.TH
169 other-extensions: TemplateHaskell
168 other-extensions: TemplateHaskell
release.nix+30−17
@@ -17,26 +17,39 @@ let
17 ] ++ lib.optionals (reflex-platform.iosSupport) [
17 ] ++ lib.optionals (reflex-platform.iosSupport) [
18 "ghcIosAarch64"
18 "ghcIosAarch64"
19 ];
19 ];
20+ variations = map (v: "reflex" + v) [
21+ "-dontUseTemplateHaskell"
22+ ""
23+ ];
20− hsPkgs = lib.genAttrs compilers (ghc: let
24+ compilerPkgs = lib.genAttrs compilers (ghc: let
21− ghc' = reflex-platform.${ghc}.override {
25+ variationPkgs = lib.genAttrs variations (variation: let
22− overrides = self: super: let
26+ reflex-platform = reflex-platform-fun {
27+ inherit system;
28+ __useTemplateHaskell = variation == "reflex"; # TODO hack
29+ haskellOverlays = [
30+ # Use this package's source for reflex
31+ (self: super: {
32+ _dep = super._dep // {
23− reflexSrc = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [
33+ reflex = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [
24− "default.nix"
25− "release.nix"
34+ "release.nix"
26− ".git"
35+ ".git"
27− "dist"
36+ "dist"
37+ "cabal.haskell-ci"
38+ "cabal.project"
39+ ".travis.yml"
28− ])) ./.;
40+ ])) ./.;
29− in {
41+ };
30− reflex-dontUseTemplateHaskell = self.callCabal2nixWithOptions "reflex" reflexSrc "-f -use-template-haskell" {};
42+ })
31− reflex = self.callCabal2nixWithOptions "reflex" reflexSrc "-f +use-template-haskell" {};
43+ ];
32 };
44 };
33− };
45+ in reflex-platform.${ghc}.reflex);
34− in {
46+ in variationPkgs // {
35− inherit (ghc') reflex reflex-dontUseTemplateHaskell;
47+ cache = reflex-platform.pinBuildInputs "reflex-${system}-${ghc}"
48+ (builtins.attrValues variationPkgs);
36 });
49 });
37− in hsPkgs // {
50+ in compilerPkgs // {
38 cache = reflex-platform.pinBuildInputs "reflex-${system}"
51 cache = reflex-platform.pinBuildInputs "reflex-${system}"
39− (lib.concatLists (map builtins.attrValues (builtins.attrValues hsPkgs)));
52+ (map (a: a.cache) (builtins.attrValues compilerPkgs));
40 });
53 });
41
54
42 metaCache = native-reflex-platform.pinBuildInputs "reflex-everywhere"
55 metaCache = native-reflex-platform.pinBuildInputs "reflex-everywhere"
src/Control/Monad/ReaderIO.hs+1−1
@@ -37,7 +37,7 @@ instance Applicative (ReaderIO e) where
37#if MIN_VERSION_base(4,10,0)
37#if MIN_VERSION_base(4,10,0)
38 liftA2 = liftM2
38 liftA2 = liftM2
39 {-# INLINE liftA2 #-}
39 {-# INLINE liftA2 #-}
40−#endif
40+#endif
41 (*>) = (>>)
41 (*>) = (>>)
42 {-# INLINE (*>) #-}
42 {-# INLINE (*>) #-}
43
43
src/Data/AppendMap.hs+1−1
@@ -20,7 +20,7 @@ module Data.AppendMap
20 , module Data.Map.Monoidal
20 , module Data.Map.Monoidal
21 ) where
21 ) where
22
22
23−import Prelude hiding (map, null)
23+import Prelude hiding (null)
24
24
25import Data.Coerce
25import Data.Coerce
26import Data.Default
26import Data.Default
src/Data/Functor/Misc.hs+1
@@ -53,6 +53,7 @@ import Data.Map (Map)
53import qualified Data.Map as Map
53import qualified Data.Map as Map
54import Data.Some (Some(Some))
54import Data.Some (Some(Some))
55import Data.These
55import Data.These
56+import Data.Type.Equality ((:~:)(Refl))
56import Data.Typeable hiding (Refl)
57import Data.Typeable hiding (Refl)
57
58
58--------------------------------------------------------------------------------
59--------------------------------------------------------------------------------
src/Reflex/Class.hs+6−2
@@ -202,7 +202,7 @@ import Data.Dependent.Map (DMap, DSum (..))
202import qualified Data.Dependent.Map as DMap
202import qualified Data.Dependent.Map as DMap
203import Data.Functor.Compose
203import Data.Functor.Compose
204import Data.Functor.Product
204import Data.Functor.Product
205−import Data.GADT.Compare (GEq (..), GCompare (..), (:~:) (..))
205+import Data.GADT.Compare (GEq (..), GCompare (..))
206import Data.FastMutableIntMap (PatchIntMap)
206import Data.FastMutableIntMap (PatchIntMap)
207import Data.Foldable
207import Data.Foldable
208import Data.Functor.Bind
208import Data.Functor.Bind
@@ -218,6 +218,7 @@ import Data.Some (Some(Some))
218import Data.String
218import Data.String
219import Data.These
219import Data.These
220import Data.Type.Coercion
220import Data.Type.Coercion
221+import Data.Type.Equality ((:~:) (..))
221import Data.Witherable (Filterable(..))
222import Data.Witherable (Filterable(..))
222import qualified Data.Witherable as W
223import qualified Data.Witherable as W
223import Reflex.FunctorMaybe (FunctorMaybe)
224import Reflex.FunctorMaybe (FunctorMaybe)
@@ -289,7 +290,8 @@ class ( MonadHold t (PushM t)
289 -- | Create an 'Event' that will occur whenever the currently-selected input
290 -- | Create an 'Event' that will occur whenever the currently-selected input
290 -- 'Event' occurs
291 -- 'Event' occurs
291 switch :: Behavior t (Event t a) -> Event t a
292 switch :: Behavior t (Event t a) -> Event t a
292− -- | Create an 'Event' that will occur whenever the input event is occurring -- and its occurrence value, another 'Event', is also occurring
293+ -- | Create an 'Event' that will occur whenever the input event is occurring -- and its occurrence value, another 'Event', is also occurring.
294+ -- You maybe looking for '@switchHold@ @never@' instead.
293 coincidence :: Event t (Event t a) -> Event t a
295 coincidence :: Event t (Event t a) -> Event t a
294 -- | Extract the 'Behavior' of a 'Dynamic'.
296 -- | Extract the 'Behavior' of a 'Dynamic'.
295 current :: Dynamic t a -> Behavior t a
297 current :: Dynamic t a -> Behavior t a
@@ -665,7 +667,9 @@ instance Reflex t => Monad (Behavior t) where
665 a >>= f = pull $ sample a >>= sample . f
667 a >>= f = pull $ sample a >>= sample . f
666 -- Note: it is tempting to write (_ >> b = b); however, this would result in (fail x >> return y) succeeding (returning y), which violates the law that (a >> b = a >>= \_ -> b), since the implementation of (>>=) above actually will fail. Since we can't examine 'Behavior's other than by using sample, I don't think it's possible to write (>>) to be more efficient than the (>>=) above.
668 -- Note: it is tempting to write (_ >> b = b); however, this would result in (fail x >> return y) succeeding (returning y), which violates the law that (a >> b = a >>= \_ -> b), since the implementation of (>>=) above actually will fail. Since we can't examine 'Behavior's other than by using sample, I don't think it's possible to write (>>) to be more efficient than the (>>=) above.
667 return = constant
669 return = constant
670+#if !MIN_VERSION_base(4,13,0)
668 fail = error "Monad (Behavior t) does not support fail"
671 fail = error "Monad (Behavior t) does not support fail"
672+#endif
669
673
670instance (Reflex t, Monoid a) => Monoid (Behavior t a) where
674instance (Reflex t, Monoid a) => Monoid (Behavior t a) where
671 mempty = constant mempty
675 mempty = constant mempty
src/Reflex/Collection.hs+1−1
@@ -130,7 +130,7 @@ listWithKeyShallowDiff initialVals valsChanged mkChild = do
130 Nothing -> Just Nothing
130 Nothing -> Just Nothing
131
131
132 -- We don't want to let spurious re-creations of items through
132 -- We don't want to let spurious re-creations of items through
133− Just _ -> Nothing
133+ Just _ -> Nothing
134 listHoldWithKey
134 listHoldWithKey
135 initialVals
135 initialVals
136 (attachWith (flip (Map.differenceWith relevantPatch))
136 (attachWith (flip (Map.differenceWith relevantPatch))
src/Reflex/Dynamic.hs+2−1
@@ -86,11 +86,12 @@ import Data.Align
86import Data.Dependent.Map (DMap)
86import Data.Dependent.Map (DMap)
87import qualified Data.Dependent.Map as DMap
87import qualified Data.Dependent.Map as DMap
88import Data.Dependent.Sum (DSum (..))
88import Data.Dependent.Sum (DSum (..))
89−import Data.GADT.Compare ((:~:) (..), GCompare (..), GEq (..), GOrdering (..))
89+import Data.GADT.Compare (GCompare (..), GEq (..), GOrdering (..))
90import Data.Map (Map)
90import Data.Map (Map)
91import Data.Maybe
91import Data.Maybe
92import Data.Monoid ((<>))
92import Data.Monoid ((<>))
93import Data.These
93import Data.These
94+import Data.Type.Equality ((:~:) (..))
94
95
95import Debug.Trace
96import Debug.Trace
96
97
src/Reflex/DynamicWriter/Class.hs−1
@@ -26,4 +26,3 @@ class (Monad m, Monoid w) => DynamicWriter t w m | m -> t w where
26
26
27instance DynamicWriter t w m => DynamicWriter t w (ReaderT r m) where
27instance DynamicWriter t w m => DynamicWriter t w (ReaderT r m) where
28 tellDyn = lift . tellDyn
28 tellDyn = lift . tellDyn
29−
src/Reflex/Network.hs+1−1
@@ -20,7 +20,7 @@ import Reflex.NotReady.Class
20import Reflex.PostBuild.Class
20import Reflex.PostBuild.Class
21
21
22-- | A 'Dynamic' "network": Takes a 'Dynamic' of network-creating actions and replaces the network whenever the 'Dynamic' updates.
22-- | A 'Dynamic' "network": Takes a 'Dynamic' of network-creating actions and replaces the network whenever the 'Dynamic' updates.
23−-- The returned Event of network results fires when the 'Dynamic' updates.
23+-- The returned Event of network results fires at post-build time and when the 'Dynamic' updates.
24-- Note: Often, the type 'a' is an Event, in which case the return value is an Event-of-Events, where the outer 'Event' fires
24-- Note: Often, the type 'a' is an Event, in which case the return value is an Event-of-Events, where the outer 'Event' fires
25-- when switching networks. Such an 'Event' would typically be flattened (via 'switchPromptly').
25-- when switching networks. Such an 'Event' would typically be flattened (via 'switchPromptly').
26networkView :: (NotReady t m, Adjustable t m, PostBuild t m) => Dynamic t (m a) -> m (Event t a)
26networkView :: (NotReady t m, Adjustable t m, PostBuild t m) => Dynamic t (m a) -> m (Event t a)
src/Reflex/PerformEvent/Base.hs+1−1
@@ -189,7 +189,7 @@ hostPerformEventT a = do
189 case mToPerform of
189 case mToPerform of
190 Nothing -> return [result']
190 Nothing -> return [result']
191 Just toPerform -> do
191 Just toPerform -> do
192− responses <- runHostFrame $ traverseRequesterData (Identity <$>) toPerform
192+ responses <- runHostFrame $ traverseRequesterData (fmap Identity) toPerform
193 mrt <- readRef responseTrigger
193 mrt <- readRef responseTrigger
194 let followupEventTriggers = case mrt of
194 let followupEventTriggers = case mrt of
195 Just rt -> [rt :=> Identity responses]
195 Just rt -> [rt :=> Identity responses]
src/Reflex/Spider/Internal.hs+25−1
@@ -43,6 +43,8 @@ import Control.Monad.Reader.Class
43import Control.Monad.IO.Class
43import Control.Monad.IO.Class
44import Control.Monad.ReaderIO
44import Control.Monad.ReaderIO
45import Control.Monad.Ref
45import Control.Monad.Ref
46+import Control.Monad.Fail (MonadFail)
47+import qualified Control.Monad.Fail as MonadFail
46import Data.Align
48import Data.Align
47import Data.Coerce
49import Data.Coerce
48import Data.Dependent.Map (DMap, DSum (..))
50import Data.Dependent.Map (DMap, DSum (..))
@@ -63,6 +65,7 @@ import Data.Monoid ((<>))
63import Data.Proxy
65import Data.Proxy
64import Data.These
66import Data.These
65import Data.Traversable
67import Data.Traversable
68+import Data.Type.Equality ((:~:)(Refl))
66import Data.Witherable (Filterable, mapMaybe)
69import Data.Witherable (Filterable, mapMaybe)
67import GHC.Exts
70import GHC.Exts
68import GHC.IORef (IORef (..))
71import GHC.IORef (IORef (..))
@@ -103,6 +106,7 @@ import qualified Reflex.Host.Class
103import Reflex.NotReady.Class
106import Reflex.NotReady.Class
104import Reflex.Patch
107import Reflex.Patch
105import qualified Reflex.Patch.DMapWithMove as PatchDMapWithMove
108import qualified Reflex.Patch.DMapWithMove as PatchDMapWithMove
109+import Reflex.PerformEvent.Base (PerformEventT)
106
110
107#ifdef DEBUG_TRACE_EVENTS
111#ifdef DEBUG_TRACE_EVENTS
108import qualified Data.ByteString.Char8 as BS8
112import qualified Data.ByteString.Char8 as BS8
@@ -971,8 +975,10 @@ instance Monad (BehaviorM x) where
971 BehaviorM x >> BehaviorM y = BehaviorM $ x >> y
975 BehaviorM x >> BehaviorM y = BehaviorM $ x >> y
972 {-# INLINE return #-}
976 {-# INLINE return #-}
973 return x = BehaviorM $ return x
977 return x = BehaviorM $ return x
978+#if !MIN_VERSION_base(4,13,0)
974 {-# INLINE fail #-}
979 {-# INLINE fail #-}
975 fail s = BehaviorM $ fail s
980 fail s = BehaviorM $ fail s
981+#endif
976
982
977data BehaviorSubscribed x a
983data BehaviorSubscribed x a
978 = forall p. BehaviorSubscribedHold (Hold x p)
984 = forall p. BehaviorSubscribedHold (Hold x p)
@@ -2356,8 +2362,10 @@ instance HasSpiderTimeline x => Monad (Reflex.Class.Dynamic (SpiderTimeline x))
2356 x >>= f = SpiderDynamic $ dynamicDynIdentity $ newJoinDyn $ newMapDyn (unSpiderDynamic . f) $ unSpiderDynamic x
2362 x >>= f = SpiderDynamic $ dynamicDynIdentity $ newJoinDyn $ newMapDyn (unSpiderDynamic . f) $ unSpiderDynamic x
2357 {-# INLINE (>>) #-}
2363 {-# INLINE (>>) #-}
2358 (>>) = (*>)
2364 (>>) = (*>)
2365+#if !MIN_VERSION_base(4,13,0)
2359 {-# INLINE fail #-}
2366 {-# INLINE fail #-}
2360 fail _ = error "Dynamic does not support 'fail'"
2367 fail _ = error "Dynamic does not support 'fail'"
2368+#endif
2361
2369
2362{-# INLINABLE newJoinDyn #-}
2370{-# INLINABLE newJoinDyn #-}
2363newJoinDyn :: HasSpiderTimeline x => DynamicS x (Identity (DynamicS x (Identity a))) -> Reflex.Spider.Internal.Dyn x (Identity a)
2371newJoinDyn :: HasSpiderTimeline x => DynamicS x (Identity (DynamicS x (Identity a))) -> Reflex.Spider.Internal.Dyn x (Identity a)
@@ -2636,8 +2644,14 @@ instance Monad (SpiderHost x) where
2636 SpiderHost x >> SpiderHost y = SpiderHost $ x >> y
2644 SpiderHost x >> SpiderHost y = SpiderHost $ x >> y
2637 {-# INLINABLE return #-}
2645 {-# INLINABLE return #-}
2638 return x = SpiderHost $ return x
2646 return x = SpiderHost $ return x
2647+#if !MIN_VERSION_base(4,13,0)
2648+ {-# INLINABLE fail #-}
2649+ fail = MonadFail.fail
2650+#endif
2651+
2652+instance MonadFail (SpiderHost x) where
2639 {-# INLINABLE fail #-}
2653 {-# INLINABLE fail #-}
2640− fail s = SpiderHost $ fail s
2654+ fail s = SpiderHost $ MonadFail.fail s
2641
2655
2642-- | Run an action affecting the global Spider timeline; this will be guarded by
2656-- | Run an action affecting the global Spider timeline; this will be guarded by
2643-- a mutex for that timeline
2657-- a mutex for that timeline
@@ -2659,8 +2673,10 @@ instance Monad (SpiderHostFrame x) where
2659 SpiderHostFrame x >> SpiderHostFrame y = SpiderHostFrame $ x >> y
2673 SpiderHostFrame x >> SpiderHostFrame y = SpiderHostFrame $ x >> y
2660 {-# INLINABLE return #-}
2674 {-# INLINABLE return #-}
2661 return x = SpiderHostFrame $ return x
2675 return x = SpiderHostFrame $ return x
2676+#if !MIN_VERSION_base(4,13,0)
2662 {-# INLINABLE fail #-}
2677 {-# INLINABLE fail #-}
2663 fail s = SpiderHostFrame $ fail s
2678 fail s = SpiderHostFrame $ fail s
2679+#endif
2664
2680
2665instance NotReady (SpiderTimeline x) (SpiderHostFrame x) where
2681instance NotReady (SpiderTimeline x) (SpiderHostFrame x) where
2666 notReadyUntil _ = pure ()
2682 notReadyUntil _ = pure ()
@@ -2705,3 +2721,11 @@ instance MonadAtomicRef (SpiderHostFrame x) where
2705instance PrimMonad (SpiderHostFrame x) where
2721instance PrimMonad (SpiderHostFrame x) where
2706 type PrimState (SpiderHostFrame x) = PrimState IO
2722 type PrimState (SpiderHostFrame x) = PrimState IO
2707 primitive = SpiderHostFrame . EventM . primitive
2723 primitive = SpiderHostFrame . EventM . primitive
2724+
2725+instance NotReady (SpiderTimeline x) (SpiderHost x) where
2726+ notReadyUntil _ = return ()
2727+ notReady = return ()
2728+
2729+instance HasSpiderTimeline x => NotReady (SpiderTimeline x) (PerformEventT (SpiderTimeline x) (SpiderHost x)) where
2730+ notReadyUntil _ = return ()
2731+ notReady = return ()
src/Reflex/Workflow.hs+1−1
@@ -34,7 +34,7 @@ workflow w0 = do
34 rec eResult <- networkHold (unWorkflow w0) $ fmap unWorkflow $ switch $ snd <$> current eResult
34 rec eResult <- networkHold (unWorkflow w0) $ fmap unWorkflow $ switch $ snd <$> current eResult
35 return $ fmap fst eResult
35 return $ fmap fst eResult
36
36
37−-- | Similar to 'workflow', but outputs an 'Event' that fires whenever the current 'Workflow' is replaced by the next 'Workflow'.
37+-- | Similar to 'workflow', but outputs an 'Event' that fires at post-build time and whenever the current 'Workflow' is replaced by the next 'Workflow'.
38workflowView :: forall t m a. (Reflex t, NotReady t m, Adjustable t m, MonadFix m, MonadHold t m, PostBuild t m) => Workflow t m a -> m (Event t a)
38workflowView :: forall t m a. (Reflex t, NotReady t m, Adjustable t m, MonadFix m, MonadHold t m, PostBuild t m) => Workflow t m a -> m (Event t a)
39workflowView w0 = do
39workflowView w0 = do
40 rec eResult <- networkView . fmap unWorkflow =<< holdDyn w0 eReplace
40 rec eResult <- networkView . fmap unWorkflow =<< holdDyn w0 eReplace
test/Reflex/Bench/Focused.hs+1−1
@@ -134,7 +134,7 @@ holdDynChain :: (Reflex t, MonadHold t m) => Word -> Dynamic t Word -> m (Dynami
134holdDynChain = iterM (\d -> sample (current d) >>= flip holdDyn (updated d))
134holdDynChain = iterM (\d -> sample (current d) >>= flip holdDyn (updated d))
135
135
136buildDynChain :: (Reflex t, MonadHold t m) => Word -> Dynamic t Word -> m (Dynamic t Word)
136buildDynChain :: (Reflex t, MonadHold t m) => Word -> Dynamic t Word -> m (Dynamic t Word)
137−buildDynChain = iterM (\d -> do
137+buildDynChain = iterM (\d -> do
138 let b = fmap (+1) (current d)
138 let b = fmap (+1) (current d)
139 e = fmap (*2) (updated d)
139 e = fmap (*2) (updated d)
140 buildDynamic (sample b) e)
140 buildDynamic (sample b) e)
test/hlint.hs−7
@@ -30,16 +30,9 @@ main = do
30 ]
30 ]
31 matchFile = and <$> sequence
31 matchFile = and <$> sequence
32 [ extension ==? ".hs"
32 [ extension ==? ".hs"
33− , let notElem' = liftOp notElem
34− in filePath `notElem'` filePathExceptions pwd
35 ]
33 ]
36 files <- find recurseInto matchFile (pwd </> "src") --TODO: Someday fix all hints in tests, etc.
34 files <- find recurseInto matchFile (pwd </> "src") --TODO: Someday fix all hints in tests, etc.
37 ideas <- fmap concat $ forM files $ \f -> do
35 ideas <- fmap concat $ forM files $ \f -> do
38 putStr $ "linting file " ++ drop (length pwd + 1) f ++ "... "
36 putStr $ "linting file " ++ drop (length pwd + 1) f ++ "... "
39 runHlint f
37 runHlint f
40 if null ideas then exitSuccess else exitFailure
38 if null ideas then exitSuccess else exitFailure
41−
42−filePathExceptions :: FilePath -> [FilePath]
43−filePathExceptions pwd = map (pwd </>) $
44− [ "src/Data/AppendMap.hs" -- parse error when hlint runs
45− ]