on develop help sign in
Merge remote-tracking branch 'origin/develop' into cleanup-debug
commitbf12730ac20108b4b17371c2fb97d44c67aa8b45 authorleon.smith@obsidian.systems <leon.smith@obsidian.systems> dateThu 9 Jan 2020, 14:54 (7 years ago) parenta6b32d302d2cef
15 files changed+55−28
.travis.yml+3−1 ChangeLog.md+6−3 cabal.haskell-ci+1 dep/reflex-platform/github.json+3−3 reflex.cabal+7−7 release.nix+3 src/Data/AppendMap.hs+1−1 src/Data/Functor/Misc.hs+1 src/Reflex/Class.hs+6−2 src/Reflex/Dynamic.hs+2−1 src/Reflex/DynamicWriter/Class.hs−1 src/Reflex/PerformEvent/Base.hs+1−1 src/Reflex/Query/Base.hs+5 src/Reflex/Spider/Internal.hs+16−1 test/hlint.hs−7
.travis.yml+3−1
@@ -28,6 +28,8 @@ matrix:
2828 include:
2929 - compiler: ghcjs-8.4
3030 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"]}}
3133 - compiler: ghc-8.6.5
3234 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}
3335 - compiler: ghc-8.4.4
@@ -163,7 +165,7 @@ script:
163165 # Constraint set no-th
164166 - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='reflex -use-template-haskell' all | color_cabal_output
165167 # 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
167169 # Constraint set old-witherable
168170 - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='witherable <0.3.2' all | color_cabal_output
169171 # Constraint set debug-propagation
ChangeLog.md+6−3
@@ -2,9 +2,12 @@
22
33## Unreleased
44
5−* Data.WeakBag.traverse and Data.FastWeakBag.traverse have been
6− renamed to Data.WeakBag.traverse_ and Data.FastWeakBag.traverse_
7− respectively.
5+* Add `Reflex.Query.Base.mapQueryT`. See that module for documentation
6+
7+## 0.6.3
8+
9+* `Data.WeakBag.traverse` and `Data.FastWeakBag.traverse` have been deprecated.
10+ They are replaced with `Data.WeakBag.traverse_` and `Data.FastWeakBag.traverse_`, respectively.
811
912* Fixes a bug in `Reflex.Patch.MapWithMove.patchThatSortsMapWith` that was producing invalid `PatchMapWithMove`.
1013
cabal.haskell-ci+1
@@ -10,6 +10,7 @@ constraint-set no-th
1010 constraints: reflex -use-template-haskell
1111
1212constraint-set old-these
13+ ghc: <8.8
1314 constraints: these <1
1415
1516constraint-set old-witherable
dep/reflex-platform/github.json+3−3
@@ -1,7 +1,7 @@
11{
22 "owner": "reflex-frp",
33 "repo": "reflex-platform",
4− "branch": "develop",
5− "rev": "e7b76dd552a10916c7d8702c11292dac4f4299ea",
6− "sha256": "0s1183arrwldcs50qhzgnv94v24n9bgq6dfq64wp0a3q2nzyvgwh"
4+ "branch": "master",
5+ "rev": "510b990d0b11f0626afbec5fe8575b5b2395391b",
6+ "sha256": "09cmahsbxr0963wq171c7j139iyzz49hramr4v9nsf684wcwkngv"
77}
reflex.cabal+7−7
@@ -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
@@ -18,7 +18,7 @@ extra-source-files:
1818 ChangeLog.md
1919
2020tested-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,
2222 GHCJS ==8.4
2323
2424flag use-reflex-optimizer
@@ -61,7 +61,7 @@ library
6161 hs-source-dirs: src
6262 build-depends:
6363 MemoTrie == 0.6.*,
64− base >= 4.9 && < 4.13,
64+ base >= 4.9 && < 4.14,
6565 bifunctors >= 5.2 && < 5.6,
6666 comonad >= 5.0.4 && < 5.1,
6767 constraints-extras >= 0.3 && < 0.4,
@@ -74,14 +74,14 @@ library
7474 mtl >= 2.1 && < 2.3,
7575 prim-uniq >= 0.1.0.1 && < 0.2,
7676 primitive >= 0.5 && < 0.8,
77− profunctors >= 5.0 && < 5.5,
77+ profunctors >= 5.3 && < 5.6,
7878 random == 1.1.*,
7979 ref-tf == 0.4.*,
8080 reflection == 2.1.*,
8181 semigroupoids >= 4.0 && < 6,
8282 stm >= 2.4 && < 2.6,
8383 syb >= 0.5 && < 0.8,
84− time >= 1.4 && < 1.9,
84+ time >= 1.4 && < 1.10,
8585 transformers >= 0.5.6.0 && < 0.6,
8686 unbounded-delays >= 0.1.0.0 && < 0.2,
8787 witherable >= 0.3 && < 0.3.2
@@ -168,9 +168,9 @@ library
168168 cpp-options: -DUSE_TEMPLATE_HASKELL
169169 build-depends:
170170 dependent-sum >= 0.6 && < 0.7,
171− haskell-src-exts >= 1.16 && < 1.22,
171+ haskell-src-exts >= 1.16 && < 1.23,
172172 haskell-src-meta >= 0.6 && < 0.9,
173− template-haskell >= 2.9 && < 2.15
173+ template-haskell >= 2.9 && < 2.16
174174 exposed-modules:
175175 Reflex.Dynamic.TH
176176 other-extensions: TemplateHaskell
release.nix+3
@@ -34,6 +34,9 @@ let
3434 "release.nix"
3535 ".git"
3636 "dist"
37+ "cabal.haskell-ci"
38+ "cabal.project"
39+ ".travis.yml"
3740 ])) ./.;
3841 };
3942 })
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/Data/Functor/Misc.hs+1
@@ -53,6 +53,7 @@ import Data.Map (Map)
5353import qualified Data.Map as Map
5454import Data.Some (Some(Some))
5555import Data.These
56+import Data.Type.Equality ((:~:)(Refl))
5657import Data.Typeable hiding (Refl)
5758
5859--------------------------------------------------------------------------------
src/Reflex/Class.hs+6−2
@@ -200,7 +200,7 @@ import Data.Dependent.Map (DMap, DSum (..))
200200import qualified Data.Dependent.Map as DMap
201201import Data.Functor.Compose
202202import Data.Functor.Product
203−import Data.GADT.Compare (GEq (..), GCompare (..), (:~:) (..))
203+import Data.GADT.Compare (GEq (..), GCompare (..))
204204import Data.FastMutableIntMap (PatchIntMap)
205205import Data.Foldable
206206import Data.Functor.Bind
@@ -215,6 +215,7 @@ import Data.Some (Some(Some))
215215import Data.String
216216import Data.These
217217import Data.Type.Coercion
218+import Data.Type.Equality ((:~:) (..))
218219import Data.Witherable (Filterable(..))
219220import qualified Data.Witherable as W
220221import Reflex.FunctorMaybe (FunctorMaybe)
@@ -286,7 +287,8 @@ class ( MonadHold t (PushM t)
286287 -- | Create an 'Event' that will occur whenever the currently-selected input
287288 -- 'Event' occurs
288289 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.
290292 coincidence :: Event t (Event t a) -> Event t a
291293 -- | Extract the 'Behavior' of a 'Dynamic'.
292294 current :: Dynamic t a -> Behavior t a
@@ -662,7 +664,9 @@ instance Reflex t => Monad (Behavior t) where
662664 a >>= f = pull $ sample a >>= sample . f
663665 -- 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.
664666 return = constant
667+#if !MIN_VERSION_base(4,13,0)
665668 fail = error "Monad (Behavior t) does not support fail"
669+#endif
666670
667671instance (Reflex t, Monoid a) => Monoid (Behavior t a) where
668672 mempty = constant mempty
src/Reflex/Dynamic.hs+2−1
@@ -87,11 +87,12 @@ import Data.Align
8787import Data.Dependent.Map (DMap)
8888import qualified Data.Dependent.Map as DMap
8989import Data.Dependent.Sum (DSum (..))
90−import Data.GADT.Compare ((:~:) (..), GCompare (..), GEq (..), GOrdering (..))
90+import Data.GADT.Compare (GCompare (..), GEq (..), GOrdering (..))
9191import Data.Map (Map)
9292import Data.Maybe
9393import Data.Monoid ((<>))
9494import Data.These
95+import Data.Type.Equality ((:~:) (..))
9596
9697import Debug.Trace
9798
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/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/Query/Base.hs+5
@@ -16,6 +16,7 @@ module Reflex.Query.Base
1616 , mapQueryResult
1717 , dynWithQueryT
1818 , withQueryT
19+ , mapQueryT
1920 ) where
2021
2122import Control.Applicative (liftA2)
@@ -287,6 +288,10 @@ withQueryT f a = do
287288 (fmapCheap (AdditivePatch . mapQuery f . unAdditivePatch) $ updatedIncremental q)
288289 return result
289290
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+
290295-- | dynWithQueryT's (Dynamic t QueryMorphism) argument needs to be a group homomorphism at all times in order to behave correctly
291296dynWithQueryT :: (MonadFix m, PostBuild t m, Group q, Additive q, Group q', Additive q', Query q')
292297 => Dynamic t (QueryMorphism q q')
src/Reflex/Spider/Internal.hs+16−1
@@ -43,6 +43,8 @@ import Control.Monad.Reader.Class
4343import Control.Monad.IO.Class
4444import Control.Monad.ReaderIO
4545import Control.Monad.Ref
46+import Control.Monad.Fail (MonadFail)
47+import qualified Control.Monad.Fail as MonadFail
4648import Data.Align
4749import Data.Coerce
4850import Data.Dependent.Map (DMap, DSum (..))
@@ -63,6 +65,7 @@ import Data.Monoid (mempty, (<>))
6365import Data.Proxy
6466import Data.These
6567import Data.Traversable
68+import Data.Type.Equality ((:~:)(Refl))
6669import Data.Witherable (Filterable, mapMaybe)
6770import GHC.Exts hiding (toList)
6871import GHC.IORef (IORef (..))
@@ -944,8 +947,10 @@ instance Monad (BehaviorM x) where
944947 BehaviorM x >> BehaviorM y = BehaviorM $ x >> y
945948 {-# INLINE return #-}
946949 return x = BehaviorM $ return x
950+#if !MIN_VERSION_base(4,13,0)
947951 {-# INLINE fail #-}
948952 fail s = BehaviorM $ fail s
953+#endif
949954
950955data BehaviorSubscribed x a
951956 = forall p. BehaviorSubscribedHold (Hold x p)
@@ -2486,8 +2491,10 @@ instance HasSpiderTimeline x => Monad (Reflex.Class.Dynamic (SpiderTimeline x))
24862491 x >>= f = SpiderDynamic $ dynamicDynIdentity $ newJoinDyn $ newMapDyn (unSpiderDynamic . f) $ unSpiderDynamic x
24872492 {-# INLINE (>>) #-}
24882493 (>>) = (*>)
2494+#if !MIN_VERSION_base(4,13,0)
24892495 {-# INLINE fail #-}
24902496 fail _ = error "Dynamic does not support 'fail'"
2497+#endif
24912498
24922499{-# INLINABLE newJoinDyn #-}
24932500newJoinDyn :: 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
27662773 SpiderHost x >> SpiderHost y = SpiderHost $ x >> y
27672774 {-# INLINABLE return #-}
27682775 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
27692782 {-# INLINABLE fail #-}
2770− fail s = SpiderHost $ fail s
2783+ fail s = SpiderHost $ MonadFail.fail s
27712784
27722785-- | Run an action affecting the global Spider timeline; this will be guarded by
27732786-- a mutex for that timeline
@@ -2789,8 +2802,10 @@ instance Monad (SpiderHostFrame x) where
27892802 SpiderHostFrame x >> SpiderHostFrame y = SpiderHostFrame $ x >> y
27902803 {-# INLINABLE return #-}
27912804 return x = SpiderHostFrame $ return x
2805+#if !MIN_VERSION_base(4,13,0)
27922806 {-# INLINABLE fail #-}
27932807 fail s = SpiderHostFrame $ fail s
2808+#endif
27942809
27952810instance NotReady (SpiderTimeline x) (SpiderHostFrame x) where
27962811 notReadyUntil _ = pure ()
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− ]