on develop help sign in
Merge branch 'develop' into develop
commit632c55c0dba1f2e3680fef546cc2d3e112f4add7 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateSun 22 Dec 2019, 13:01 (7 years ago) parent822a3c34b04fc4
17 files changed+88−100
ChangeLog.md+25−8 Quickref.md+14−11 default.nix−49 dep/reflex-platform/github.json+3−3 reflex.cabal+2−3 release.nix+27−10 src/Control/Monad/ReaderIO.hs+1−1 src/Data/AppendMap.hs+1−1 src/Reflex/Collection.hs+1−1 src/Reflex/DynamicWriter/Class.hs−1 src/Reflex/Network.hs+1−1 src/Reflex/Patch/MapWithMove.hs+1−1 src/Reflex/PerformEvent/Base.hs+1−1 src/Reflex/Spider/Internal.hs+9 src/Reflex/Workflow.hs+1−1 test/Reflex/Bench/Focused.hs+1−1 test/hlint.hs−7
ChangeLog.md+25−8
@@ -1,10 +1,15 @@
11# Revision history for reflex
22
3−## Unreleased
3+## 0.6.3
44
5−* Data.WeakBag.traverse and Data.FastWeakBag.traverse have been
6− renamed to Data.WeakBag.traverse_ and Data.FastWeakBag.traverse_
7− respectively.
5+* `Data.WeakBag.traverse` and `Data.FastWeakBag.traverse` have been deprecated.
6+ They are replaced with `Data.WeakBag.traverse_` and `Data.FastWeakBag.traverse_`, respectively.
7+
8+* Fixes a bug in `Reflex.Patch.MapWithMove.patchThatSortsMapWith` that was producing invalid `PatchMapWithMove`.
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))`
813
914## 0.6.2.4
1015
@@ -17,7 +22,9 @@
1722## 0.6.2.2
1823
1924* Support these >= 1. Add `split-these` flag to control whether to use new these/semialign combination or not.
25+
2026* Update version bounds to fix some CI failures
27+
2128* Add travis CI configuration
2229
2330## 0.6.2.1
@@ -32,32 +39,42 @@
3239 * Add incrementalCoercion/coerceIncremental to go with dynamicCoercion/coerceDynamic
3340
3441* Generalize merging functions:
35− `merge` to `mergeG`,
36− `mergeIncremental` to `mergeIncrementalG`,
37− `mergeIncrementalWithMove` to `mergeIncrementalWithMoveG`.
42+ `merge` to `mergeG`,
43+ `mergeIncremental` to `mergeIncrementalG`,
44+ `mergeIncrementalWithMove` to `mergeIncrementalWithMoveG`.
3845
3946* Generalize distribute function:
4047 `distributeDMapOverDynPure` to `distributeDMapOverDynPureG`,
4148
4249## 0.6.2.0
4350
44−* Fix `holdDyn` so that it is lazy in its event argument
51+* Fix `holdDyn` so that it is lazy in its event argument
4552 These produce `DMap`s whose values needn't be `Identity`.
53+
4654* Stop using the now-deprecated `*Tag` classes (e.g., `ShowTag`).
55+
4756* Fix `holdDyn` so that it is lazy in its event argument.
4857
4958## 0.6.1.0
5059
5160* Re-export all of `Data.Map.Monoidal`
61+
5262* Fix `QueryT` and `RequesterT` tests
5363
5464## 0.6.0.0 -- 2019-03-20
5565
5666* Deprecate `FunctorMaybe` in favor of `Data.Witherable.Filterable`. We still export `fmapMaybe`, `ffilter`, etc., but they all rely on `Filterable` now.
67+
5768* Rename `MonadDynamicWriter` to `DynamicWriter` and add a deprecation for the old name.
69+
5870* Remove many deprecated functions.
71+
5972* Add a `Num` instance for `Dynamic`.
73+
6074* Add `matchRequestsWithResponses` to make it easier to use `Requester` with protocols that don't do this matching for you.
75+
6176* Add `withRequesterT` to map functions over the request and response of a `RequesterT`.
77+
6278* Suppress nil patches in `QueryT` as an optimization. The `Query` type must now have an `Eq` instance.
79+
6380* 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
198198The functions mentioned above are used to create a static FRP network.
199199There 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.
200200
201−Th typeclasses and their associated annotations include:
201+The typeclasses and their associated annotations include:
202202
203203- `PostBuild`
204204 Fire an Event when an FRP network has been set up.
@@ -206,7 +206,7 @@ Th typeclasses and their associated annotations include:
206206 [B] -- Function runs in any monad supporting PostBuild
207207 ```
208208
209−- `Adjustable`
209+- `Adjustable`
210210 Use Events to add or remove pieces of an FRP network.
211211 ```haskell
212212 [A] -- Function runs in any monad supporting Adjustable
@@ -271,7 +271,7 @@ Th typeclasses and their associated annotations include:
271271```haskell
272272-- Run side-effecting actions in Event when it occurs; returned Event contains
273273-- 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.
275275-- This allows for working with IO when a ((MonadIO (Performable m)) constraint is available.
276276[P] performEvent :: Event (Performable m a ) -> m (Event a)
277277
@@ -295,17 +295,20 @@ Th typeclasses and their associated annotations include:
295295## Networks
296296
297297```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)
299299
300−-- 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,
300+[A] runWithReplace :: m a -> Event t (m b) -> m (a, Event t b)
301+
302+-- Given a Dynamic of network-creating actions, create a network that is recreated whenever the Dynamic updates.
303+-- The returned Event of network results occurs when the Dynamic does. Note: Often, the type a is an Event,
302304-- 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)
304306
305−-- 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
307+-- Given an initial network and an Event of network-creating actions, create a network that is recreated whenever the
308+-- Event fires. The returned Dynamic of network results occurs when the Event does. Note: Often, the type a is an
307309-- 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)
309311
310312-- 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+```
default.nixdeleted−49
@@ -1,49 +0,0 @@
1−{ mkDerivation, ghc, base, bifunctors, containers, deepseq
2−, dependent-map, dependent-sum, exception-transformers
3−, haskell-src-exts, haskell-src-meta, hlint, lens, MemoTrie
4−, monad-control, mtl, primitive, random, ref-tf
5−, semigroupoids , semigroups, split, stdenv, stm, syb
6−, template-haskell , these, time, transformers
7−, transformers-compat, unbounded-delays, prim-uniq
8−, data-default, filepath, directory, filemanip, ghcjs-base
9−, monoidal-containers, witherable, profunctors
10−, splitThese ? (semialign != null), semialign ? null, these-lens ? null
11−, useTemplateHaskell ? true
12−}:
13−mkDerivation {
14− pname = "reflex";
15− version = "0.6.2.4";
16− src = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [
17− "default.nix"
18− "release.nix"
19− ".git"
20− "dist"
21− ])) ./.;
22− libraryHaskellDepends = [
23− base bifunctors containers dependent-map dependent-sum
24− exception-transformers lens
25− MemoTrie monad-control mtl primitive ref-tf semigroupoids
26− semigroups stm syb template-haskell these transformers
27− transformers-compat prim-uniq
28− base bifunctors containers deepseq dependent-map dependent-sum
29− mtl ref-tf split transformers data-default
30− random time unbounded-delays monoidal-containers witherable
31− profunctors
32− ] ++ (if ghc.isGhcjs or false then [
33− ghcjs-base
34− ] else []) ++ (if !useTemplateHaskell then [] else [
35− haskell-src-exts haskell-src-meta
36− ]) ++ (if splitThese then [
37− semialign
38− these-lens
39− ] else []);
40− testHaskellDepends = if ghc.isGhcjs or false then [] else [
41− hlint filepath directory filemanip
42− ];
43− configureFlags =
44− stdenv.lib.optional (!useTemplateHaskell) [ "-f-use-template-haskell" ] ++
45− stdenv.lib.optional (!splitThese) [ "-f-split-these" ];
46− homepage = "https://github.com/reflex-frp/reflex";
47− description = "Higher-order Functional Reactive Programming";
48− license = stdenv.lib.licenses.bsd3;
49−}
dep/reflex-platform/github.json+3−3
@@ -1,7 +1,7 @@
11{
22 "owner": "reflex-frp",
33 "repo": "reflex-platform",
4− "branch": "jailbreakTheselens",
5− "rev": "4284ed527c96c373538dc7e31776d9a50ca6aa91",
6− "sha256": "1m1nkxq7ng9wnqbd77xn8d81f2iz8g61y5m0r3gp0gi0q59jm8ay"
4+ "branch": "develop",
5+ "rev": "e7b76dd552a10916c7d8702c11292dac4f4299ea",
6+ "sha256": "0s1183arrwldcs50qhzgnv94v24n9bgq6dfq64wp0a3q2nzyvgwh"
77}
reflex.cabal+2−3
@@ -1,5 +1,5 @@
11Name: reflex
2−Version: 0.6.2.4
2+Version: 0.6.3
33Synopsis: Higher-order Functional Reactive Programming
44Description: Reflex is a high-performance, deterministic, higher-order Functional Reactive Programming system
55License: BSD3
@@ -58,13 +58,12 @@ library
5858 data-default >= 0.5 && < 0.8,
5959 dependent-map >= 0.3 && < 0.4,
6060 exception-transformers == 0.4.*,
61− profunctors >= 5.3 && < 5.5,
6261 lens >= 4.7 && < 5,
6362 monad-control >= 1.0.1 && < 1.1,
6463 mtl >= 2.1 && < 2.3,
6564 prim-uniq >= 0.1.0.1 && < 0.2,
6665 primitive >= 0.5 && < 0.8,
67− profunctors,
66+ profunctors >= 5.3 && < 5.5,
6867 random == 1.1.*,
6968 ref-tf == 0.4.*,
7069 reflection == 2.1.*,
release.nix+27−10
@@ -17,19 +17,36 @@ let
1717 ] ++ lib.optionals (reflex-platform.iosSupport) [
1818 "ghcIosAarch64"
1919 ];
20− hsPkgs = lib.genAttrs compilers (ghc: let
21− ghc' = reflex-platform.${ghc}.override {
22− overrides = self: super: {
23− reflex-dontUseTemplateHaskell = self.callPackage ./. { useTemplateHaskell = false; };
24− reflex = self.callPackage ./. { useTemplateHaskell = true; };
20+ variations = map (v: "reflex" + v) [
21+ "-dontUseTemplateHaskell"
22+ ""
23+ ];
24+ compilerPkgs = lib.genAttrs compilers (ghc: let
25+ variationPkgs = lib.genAttrs variations (variation: 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 // {
33+ reflex = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [
34+ "release.nix"
35+ ".git"
36+ "dist"
37+ ])) ./.;
38+ };
39+ })
40+ ];
2541 };
26− };
27− in {
28− inherit (ghc') reflex reflex-dontUseTemplateHaskell;
42+ in reflex-platform.${ghc}.reflex);
43+ in variationPkgs // {
44+ cache = reflex-platform.pinBuildInputs "reflex-${system}-${ghc}"
45+ (builtins.attrValues variationPkgs);
2946 });
30− in hsPkgs // {
47+ in compilerPkgs // {
3148 cache = reflex-platform.pinBuildInputs "reflex-${system}"
32− (lib.concatLists (map builtins.attrValues (builtins.attrValues hsPkgs)));
49+ (map (a: a.cache) (builtins.attrValues compilerPkgs));
3350 });
3451
3552 metaCache = native-reflex-platform.pinBuildInputs "reflex-everywhere"
src/Control/Monad/ReaderIO.hs+1−1
@@ -37,7 +37,7 @@ instance Applicative (ReaderIO e) where
3737#if MIN_VERSION_base(4,10,0)
3838 liftA2 = liftM2
3939 {-# INLINE liftA2 #-}
40−#endif
40+#endif
4141 (*>) = (>>)
4242 {-# INLINE (*>) #-}
4343
src/Data/AppendMap.hs+1−1
@@ -20,7 +20,7 @@ module Data.AppendMap
2020 , module Data.Map.Monoidal
2121 ) where
2222
23−import Prelude hiding (map, null)
23+import Prelude hiding (null)
2424
2525import Data.Coerce
2626import Data.Default
src/Reflex/Collection.hs+1−1
@@ -130,7 +130,7 @@ listWithKeyShallowDiff initialVals valsChanged mkChild = do
130130 Nothing -> Just Nothing
131131
132132 -- We don't want to let spurious re-creations of items through
133− Just _ -> Nothing
133+ Just _ -> Nothing
134134 listHoldWithKey
135135 initialVals
136136 (attachWith (flip (Map.differenceWith relevantPatch))
src/Reflex/DynamicWriter/Class.hs−1
@@ -26,4 +26,3 @@ class (Monad m, Monoid w) => DynamicWriter t w m | m -> t w where
2626
2727instance DynamicWriter t w m => DynamicWriter t w (ReaderT r m) where
2828 tellDyn = lift . tellDyn
29−
src/Reflex/Network.hs+1−1
@@ -20,7 +20,7 @@ import Reflex.NotReady.Class
2020import Reflex.PostBuild.Class
2121
2222-- | 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.
2424-- Note: Often, the type 'a' is an Event, in which case the return value is an Event-of-Events, where the outer 'Event' fires
2525-- when switching networks. Such an 'Event' would typically be flattened (via 'switchPromptly').
2626networkView :: (NotReady t m, Adjustable t m, PostBuild t m) => Dynamic t (m a) -> m (Event t a)
src/Reflex/Patch/MapWithMove.hs+1−1
@@ -155,7 +155,7 @@ patchThatSortsMapWith cmp m = PatchMapWithMove $ Map.fromList $ catMaybes $ zipW
155155 Just (from, to)
156156 reverseMapping = Map.fromList $ catMaybes $ zipWith f unsorted sorted
157157 g (to, _) (from, _) = if to == from then Nothing else
158− let Just movingTo = Map.lookup from reverseMapping
158+ let Just movingTo = Map.lookup to reverseMapping
159159 in Just (to, NodeInfo (From_Move from) $ Just movingTo)
160160
161161-- | Create a 'PatchMapWithMove' that, if applied to the first 'Map' provided,
src/Reflex/PerformEvent/Base.hs+1−1
@@ -141,7 +141,7 @@ hostPerformEventT a = do
141141 case mToPerform of
142142 Nothing -> return [result']
143143 Just toPerform -> do
144− responses <- runHostFrame $ traverseRequesterData (Identity <$>) toPerform
144+ responses <- runHostFrame $ traverseRequesterData (fmap Identity) toPerform
145145 mrt <- readRef responseTrigger
146146 let followupEventTriggers = case mrt of
147147 Just rt -> [rt :=> Identity responses]
src/Reflex/Spider/Internal.hs+9
@@ -103,6 +103,7 @@ import qualified Reflex.Host.Class
103103import Reflex.NotReady.Class
104104import Reflex.Patch
105105import qualified Reflex.Patch.DMapWithMove as PatchDMapWithMove
106+import Reflex.PerformEvent.Base (PerformEventT)
106107
107108#ifdef DEBUG_TRACE_EVENTS
108109import qualified Data.ByteString.Char8 as BS8
@@ -2705,3 +2706,11 @@ instance MonadAtomicRef (SpiderHostFrame x) where
27052706instance PrimMonad (SpiderHostFrame x) where
27062707 type PrimState (SpiderHostFrame x) = PrimState IO
27072708 primitive = SpiderHostFrame . EventM . primitive
2709+
2710+instance NotReady (SpiderTimeline x) (SpiderHost x) where
2711+ notReadyUntil _ = return ()
2712+ notReady = return ()
2713+
2714+instance HasSpiderTimeline x => NotReady (SpiderTimeline x) (PerformEventT (SpiderTimeline x) (SpiderHost x)) where
2715+ notReadyUntil _ = return ()
2716+ notReady = return ()
src/Reflex/Workflow.hs+1−1
@@ -34,7 +34,7 @@ workflow w0 = do
3434 rec eResult <- networkHold (unWorkflow w0) $ fmap unWorkflow $ switch $ snd <$> current eResult
3535 return $ fmap fst eResult
3636
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'.
3838workflowView :: 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)
3939workflowView w0 = do
4040 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
134134holdDynChain = iterM (\d -> sample (current d) >>= flip holdDyn (updated d))
135135
136136buildDynChain :: (Reflex t, MonadHold t m) => Word -> Dynamic t Word -> m (Dynamic t Word)
137−buildDynChain = iterM (\d -> do
137+buildDynChain = iterM (\d -> do
138138 let b = fmap (+1) (current d)
139139 e = fmap (*2) (updated d)
140140 buildDynamic (sample b) e)
test/hlint.hs−7
@@ -30,16 +30,9 @@ main = do
3030 ]
3131 matchFile = and <$> sequence
3232 [ extension ==? ".hs"
33− , let notElem' = liftOp notElem
34− in filePath `notElem'` filePathExceptions pwd
3533 ]
3634 files <- find recurseInto matchFile (pwd </> "src") --TODO: Someday fix all hints in tests, etc.
3735 ideas <- fmap concat $ forM files $ \f -> do
3836 putStr $ "linting file " ++ drop (length pwd + 1) f ++ "... "
3937 runHlint f
4038 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− ]