on develop help sign in
Merge remote-tracking branch 'origin/develop' into cleanup-debug
bf12730leon.smith@obsidian.systems
.travis.yml+3−1
@@ -28,6 +28,8 @@ matrix:
28 include:
28 include:
29 - compiler: ghcjs-8.4
29 - compiler: ghcjs-8.4
30 addons: {"apt":{"sources":["hvr-ghc"],"packages":["cabal-install-3.0"]}}
30 addons: {"apt":{"sources":["hvr-ghc"],"packages":["cabal-install-3.0"]}}
31+ - compiler: ghc-8.8.1
32+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}}
31 - compiler: ghc-8.6.5
33 - compiler: ghc-8.6.5
32 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}
34 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}
33 - compiler: ghc-8.4.4
35 - 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 # Constraint set debug-propagation
171 # Constraint set debug-propagation
ChangeLog.md+6−3
@@ -2,9 +2,12 @@
2
2
3## Unreleased
3## Unreleased
4
4
5+* Add `Reflex.Query.Base.mapQueryT`. See that module for documentation
6+
7+## 0.6.3
8+
5−* Data.WeakBag.traverse and Data.FastWeakBag.traverse have been
9+* `Data.WeakBag.traverse` and `Data.FastWeakBag.traverse` have been deprecated.
6− renamed to Data.WeakBag.traverse_ and Data.FastWeakBag.traverse_
10+ They are replaced with `Data.WeakBag.traverse_` and `Data.FastWeakBag.traverse_`, respectively.
7− respectively.
8
11
9* Fixes a bug in `Reflex.Patch.MapWithMove.patchThatSortsMapWith` that was producing invalid `PatchMapWithMove`.
12* Fixes a bug in `Reflex.Patch.MapWithMove.patchThatSortsMapWith` that was producing invalid `PatchMapWithMove`.
10
13
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": "develop",
4+ "branch": "master",
5− "rev": "e7b76dd552a10916c7d8702c11292dac4f4299ea",
5+ "rev": "510b990d0b11f0626afbec5fe8575b5b2395391b",
6− "sha256": "0s1183arrwldcs50qhzgnv94v24n9bgq6dfq64wp0a3q2nzyvgwh"
6+ "sha256": "09cmahsbxr0963wq171c7j139iyzz49hramr4v9nsf684wcwkngv"
7}
7}
reflex.cabal+7−7
@@ -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
@@ -61,7 +61,7 @@ library
61 hs-source-dirs: src
61 hs-source-dirs: src
62 build-depends:
62 build-depends:
63 MemoTrie == 0.6.*,
63 MemoTrie == 0.6.*,
64− base >= 4.9 && < 4.13,
64+ base >= 4.9 && < 4.14,
65 bifunctors >= 5.2 && < 5.6,
65 bifunctors >= 5.2 && < 5.6,
66 comonad >= 5.0.4 && < 5.1,
66 comonad >= 5.0.4 && < 5.1,
67 constraints-extras >= 0.3 && < 0.4,
67 constraints-extras >= 0.3 && < 0.4,
@@ -74,14 +74,14 @@ library
74 mtl >= 2.1 && < 2.3,
74 mtl >= 2.1 && < 2.3,
75 prim-uniq >= 0.1.0.1 && < 0.2,
75 prim-uniq >= 0.1.0.1 && < 0.2,
76 primitive >= 0.5 && < 0.8,
76 primitive >= 0.5 && < 0.8,
77− profunctors >= 5.0 && < 5.5,
77+ profunctors >= 5.3 && < 5.6,
78 random == 1.1.*,
78 random == 1.1.*,
79 ref-tf == 0.4.*,
79 ref-tf == 0.4.*,
80 reflection == 2.1.*,
80 reflection == 2.1.*,
81 semigroupoids >= 4.0 && < 6,
81 semigroupoids >= 4.0 && < 6,
82 stm >= 2.4 && < 2.6,
82 stm >= 2.4 && < 2.6,
83 syb >= 0.5 && < 0.8,
83 syb >= 0.5 && < 0.8,
84− time >= 1.4 && < 1.9,
84+ time >= 1.4 && < 1.10,
85 transformers >= 0.5.6.0 && < 0.6,
85 transformers >= 0.5.6.0 && < 0.6,
86 unbounded-delays >= 0.1.0.0 && < 0.2,
86 unbounded-delays >= 0.1.0.0 && < 0.2,
87 witherable >= 0.3 && < 0.3.2
87 witherable >= 0.3 && < 0.3.2
@@ -168,9 +168,9 @@ library
168 cpp-options: -DUSE_TEMPLATE_HASKELL
168 cpp-options: -DUSE_TEMPLATE_HASKELL
169 build-depends:
169 build-depends:
170 dependent-sum >= 0.6 && < 0.7,
170 dependent-sum >= 0.6 && < 0.7,
171− haskell-src-exts >= 1.16 && < 1.22,
171+ haskell-src-exts >= 1.16 && < 1.23,
172 haskell-src-meta >= 0.6 && < 0.9,
172 haskell-src-meta >= 0.6 && < 0.9,
173− template-haskell >= 2.9 && < 2.15
173+ template-haskell >= 2.9 && < 2.16
174 exposed-modules:
174 exposed-modules:
175 Reflex.Dynamic.TH
175 Reflex.Dynamic.TH
176 other-extensions: TemplateHaskell
176 other-extensions: TemplateHaskell
release.nix+3
@@ -34,6 +34,9 @@ let
34 "release.nix"
34 "release.nix"
35 ".git"
35 ".git"
36 "dist"
36 "dist"
37+ "cabal.haskell-ci"
38+ "cabal.project"
39+ ".travis.yml"
37 ])) ./.;
40 ])) ./.;
38 };
41 };
39 })
42 })
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
@@ -200,7 +200,7 @@ import Data.Dependent.Map (DMap, DSum (..))
200import qualified Data.Dependent.Map as DMap
200import qualified Data.Dependent.Map as DMap
201import Data.Functor.Compose
201import Data.Functor.Compose
202import Data.Functor.Product
202import Data.Functor.Product
203−import Data.GADT.Compare (GEq (..), GCompare (..), (:~:) (..))
203+import Data.GADT.Compare (GEq (..), GCompare (..))
204import Data.FastMutableIntMap (PatchIntMap)
204import Data.FastMutableIntMap (PatchIntMap)
205import Data.Foldable
205import Data.Foldable
206import Data.Functor.Bind
206import Data.Functor.Bind
@@ -215,6 +215,7 @@ import Data.Some (Some(Some))
215import Data.String
215import Data.String
216import Data.These
216import Data.These
217import Data.Type.Coercion
217import Data.Type.Coercion
218+import Data.Type.Equality ((:~:) (..))
218import Data.Witherable (Filterable(..))
219import Data.Witherable (Filterable(..))
219import qualified Data.Witherable as W
220import qualified Data.Witherable as W
220import Reflex.FunctorMaybe (FunctorMaybe)
221import Reflex.FunctorMaybe (FunctorMaybe)
@@ -286,7 +287,8 @@ class ( MonadHold t (PushM t)
286 -- | Create an 'Event' that will occur whenever the currently-selected input
287 -- | Create an 'Event' that will occur whenever the currently-selected input
287 -- 'Event' occurs
288 -- 'Event' occurs
288 switch :: Behavior t (Event t a) -> Event t a
289 switch :: Behavior t (Event t a) -> Event t a
289− -- | Create an 'Event' that will occur whenever the input event is occurring -- and its occurrence value, another 'Event', is also occurring
290+ -- | Create an 'Event' that will occur whenever the input event is occurring -- and its occurrence value, another 'Event', is also occurring.
291+ -- You maybe looking for '@switchHold@ @never@' instead.
290 coincidence :: Event t (Event t a) -> Event t a
292 coincidence :: Event t (Event t a) -> Event t a
291 -- | Extract the 'Behavior' of a 'Dynamic'.
293 -- | Extract the 'Behavior' of a 'Dynamic'.
292 current :: Dynamic t a -> Behavior t a
294 current :: Dynamic t a -> Behavior t a
@@ -662,7 +664,9 @@ instance Reflex t => Monad (Behavior t) where
662 a >>= f = pull $ sample a >>= sample . f
664 a >>= f = pull $ sample a >>= sample . f
663 -- 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.
665 -- 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.
664 return = constant
666 return = constant
667+#if !MIN_VERSION_base(4,13,0)
665 fail = error "Monad (Behavior t) does not support fail"
668 fail = error "Monad (Behavior t) does not support fail"
669+#endif
666
670
667instance (Reflex t, Monoid a) => Monoid (Behavior t a) where
671instance (Reflex t, Monoid a) => Monoid (Behavior t a) where
668 mempty = constant mempty
672 mempty = constant mempty
src/Reflex/Dynamic.hs+2−1
@@ -87,11 +87,12 @@ import Data.Align
87import Data.Dependent.Map (DMap)
87import Data.Dependent.Map (DMap)
88import qualified Data.Dependent.Map as DMap
88import qualified Data.Dependent.Map as DMap
89import Data.Dependent.Sum (DSum (..))
89import Data.Dependent.Sum (DSum (..))
90−import Data.GADT.Compare ((:~:) (..), GCompare (..), GEq (..), GOrdering (..))
90+import Data.GADT.Compare (GCompare (..), GEq (..), GOrdering (..))
91import Data.Map (Map)
91import Data.Map (Map)
92import Data.Maybe
92import Data.Maybe
93import Data.Monoid ((<>))
93import Data.Monoid ((<>))
94import Data.These
94import Data.These
95+import Data.Type.Equality ((:~:) (..))
95
96
96import Debug.Trace
97import Debug.Trace
97
98
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/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 (Identity <$>) toPerform
144+ responses <- runHostFrame $ traverseRequesterData (fmap 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/Query/Base.hs+5
@@ -16,6 +16,7 @@ module Reflex.Query.Base
16 , mapQueryResult
16 , mapQueryResult
17 , dynWithQueryT
17 , dynWithQueryT
18 , withQueryT
18 , withQueryT
19+ , mapQueryT
19 ) where
20 ) where
20
21
21import Control.Applicative (liftA2)
22import Control.Applicative (liftA2)
@@ -287,6 +288,10 @@ withQueryT f a = do
287 (fmapCheap (AdditivePatch . mapQuery f . unAdditivePatch) $ updatedIncremental q)
288 (fmapCheap (AdditivePatch . mapQuery f . unAdditivePatch) $ updatedIncremental q)
288 return result
289 return result
289
290
291+-- | Maps a function over a 'QueryT' that can change the underlying monad
292+mapQueryT :: (forall b. m b -> n b) -> QueryT t q m a -> QueryT t q n a
293+mapQueryT f (QueryT a) = QueryT $ mapStateT (mapEventWriterT (mapReaderT f)) a
294+
290-- | dynWithQueryT's (Dynamic t QueryMorphism) argument needs to be a group homomorphism at all times in order to behave correctly
295-- | dynWithQueryT's (Dynamic t QueryMorphism) argument needs to be a group homomorphism at all times in order to behave correctly
291dynWithQueryT :: (MonadFix m, PostBuild t m, Group q, Additive q, Group q', Additive q', Query q')
296dynWithQueryT :: (MonadFix m, PostBuild t m, Group q, Additive q, Group q', Additive q', Query q')
292 => Dynamic t (QueryMorphism q q')
297 => Dynamic t (QueryMorphism q q')
src/Reflex/Spider/Internal.hs+16−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 (mempty, (<>))
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 hiding (toList)
70import GHC.Exts hiding (toList)
68import GHC.IORef (IORef (..))
71import GHC.IORef (IORef (..))
@@ -944,8 +947,10 @@ instance Monad (BehaviorM x) where
944 BehaviorM x >> BehaviorM y = BehaviorM $ x >> y
947 BehaviorM x >> BehaviorM y = BehaviorM $ x >> y
945 {-# INLINE return #-}
948 {-# INLINE return #-}
946 return x = BehaviorM $ return x
949 return x = BehaviorM $ return x
950+#if !MIN_VERSION_base(4,13,0)
947 {-# INLINE fail #-}
951 {-# INLINE fail #-}
948 fail s = BehaviorM $ fail s
952 fail s = BehaviorM $ fail s
953+#endif
949
954
950data BehaviorSubscribed x a
955data BehaviorSubscribed x a
951 = forall p. BehaviorSubscribedHold (Hold x p)
956 = forall p. BehaviorSubscribedHold (Hold x p)
@@ -2486,8 +2491,10 @@ instance HasSpiderTimeline x => Monad (Reflex.Class.Dynamic (SpiderTimeline x))
2486 x >>= f = SpiderDynamic $ dynamicDynIdentity $ newJoinDyn $ newMapDyn (unSpiderDynamic . f) $ unSpiderDynamic x
2491 x >>= f = SpiderDynamic $ dynamicDynIdentity $ newJoinDyn $ newMapDyn (unSpiderDynamic . f) $ unSpiderDynamic x
2487 {-# INLINE (>>) #-}
2492 {-# INLINE (>>) #-}
2488 (>>) = (*>)
2493 (>>) = (*>)
2494+#if !MIN_VERSION_base(4,13,0)
2489 {-# INLINE fail #-}
2495 {-# INLINE fail #-}
2490 fail _ = error "Dynamic does not support 'fail'"
2496 fail _ = error "Dynamic does not support 'fail'"
2497+#endif
2491
2498
2492{-# INLINABLE newJoinDyn #-}
2499{-# INLINABLE newJoinDyn #-}
2493newJoinDyn :: HasSpiderTimeline x => DynamicS x (Identity (DynamicS x (Identity a))) -> Reflex.Spider.Internal.Dyn x (Identity a)
2500newJoinDyn :: HasSpiderTimeline x => DynamicS x (Identity (DynamicS x (Identity a))) -> Reflex.Spider.Internal.Dyn x (Identity a)
@@ -2766,8 +2773,14 @@ instance Monad (SpiderHost x) where
2766 SpiderHost x >> SpiderHost y = SpiderHost $ x >> y
2773 SpiderHost x >> SpiderHost y = SpiderHost $ x >> y
2767 {-# INLINABLE return #-}
2774 {-# INLINABLE return #-}
2768 return x = SpiderHost $ return x
2775 return x = SpiderHost $ return x
2776+#if !MIN_VERSION_base(4,13,0)
2777+ {-# INLINABLE fail #-}
2778+ fail = MonadFail.fail
2779+#endif
2780+
2781+instance MonadFail (SpiderHost x) where
2769 {-# INLINABLE fail #-}
2782 {-# INLINABLE fail #-}
2770− fail s = SpiderHost $ fail s
2783+ fail s = SpiderHost $ MonadFail.fail s
2771
2784
2772-- | Run an action affecting the global Spider timeline; this will be guarded by
2785-- | Run an action affecting the global Spider timeline; this will be guarded by
2773-- a mutex for that timeline
2786-- a mutex for that timeline
@@ -2789,8 +2802,10 @@ instance Monad (SpiderHostFrame x) where
2789 SpiderHostFrame x >> SpiderHostFrame y = SpiderHostFrame $ x >> y
2802 SpiderHostFrame x >> SpiderHostFrame y = SpiderHostFrame $ x >> y
2790 {-# INLINABLE return #-}
2803 {-# INLINABLE return #-}
2791 return x = SpiderHostFrame $ return x
2804 return x = SpiderHostFrame $ return x
2805+#if !MIN_VERSION_base(4,13,0)
2792 {-# INLINABLE fail #-}
2806 {-# INLINABLE fail #-}
2793 fail s = SpiderHostFrame $ fail s
2807 fail s = SpiderHostFrame $ fail s
2808+#endif
2794
2809
2795instance NotReady (SpiderTimeline x) (SpiderHostFrame x) where
2810instance NotReady (SpiderTimeline x) (SpiderHostFrame x) where
2796 notReadyUntil _ = pure ()
2811 notReadyUntil _ = pure ()
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− ]