on develop help sign in
Allow these-1, HLint fixes
61b5222Oleg Grenrus
.travis.yml+10
@@ -108,6 +108,11 @@ install:
108 echo " type: git" >> cabal.project
108 echo " type: git" >> cabal.project
109 echo " location: https://github.com/obsidiansystems/dependent-map.git" >> cabal.project
109 echo " location: https://github.com/obsidiansystems/dependent-map.git" >> cabal.project
110 echo " tag: a9a438b1fd974891e4ed57cbd43e305cf7c759a9" >> cabal.project
110 echo " tag: a9a438b1fd974891e4ed57cbd43e305cf7c759a9" >> cabal.project
111+ echo "" >> cabal.project
112+ echo "source-repository-package" >> cabal.project
113+ echo " type: git" >> cabal.project
114+ echo " location: https://github.com/phadej/monoidal-containers.git" >> cabal.project
115+ echo " tag: f8860ba08385f77128efb45fb9193e6d287e893f" >> cabal.project
111 - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(reflex)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
116 - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(reflex)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
112 - cat cabal.project || true
117 - cat cabal.project || true
113 - cat cabal.project.local || true
118 - cat cabal.project.local || true
@@ -141,6 +146,11 @@ script:
141 echo " type: git" >> cabal.project
146 echo " type: git" >> cabal.project
142 echo " location: https://github.com/obsidiansystems/dependent-map.git" >> cabal.project
147 echo " location: https://github.com/obsidiansystems/dependent-map.git" >> cabal.project
143 echo " tag: a9a438b1fd974891e4ed57cbd43e305cf7c759a9" >> cabal.project
148 echo " tag: a9a438b1fd974891e4ed57cbd43e305cf7c759a9" >> cabal.project
149+ echo "" >> cabal.project
150+ echo "source-repository-package" >> cabal.project
151+ echo " type: git" >> cabal.project
152+ echo " location: https://github.com/phadej/monoidal-containers.git" >> cabal.project
153+ echo " tag: f8860ba08385f77128efb45fb9193e6d287e893f" >> cabal.project
144 - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(reflex)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
154 - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(reflex)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
145 - cat cabal.project || true
155 - cat cabal.project || true
146 - cat cabal.project.local || true
156 - cat cabal.project.local || true
cabal.project+5
@@ -12,3 +12,8 @@ source-repository-package
12 type: git
12 type: git
13 location: https://github.com/obsidiansystems/dependent-map.git
13 location: https://github.com/obsidiansystems/dependent-map.git
14 tag: a9a438b1fd974891e4ed57cbd43e305cf7c759a9
14 tag: a9a438b1fd974891e4ed57cbd43e305cf7c759a9
15+
16+source-repository-package
17+ type: git
18+ location: https://github.com/phadej/monoidal-containers.git
19+ tag: f8860ba08385f77128efb45fb9193e6d287e893f
reflex.cabal+33−4
@@ -40,6 +40,11 @@ flag fast-weak
40 default: False
40 default: False
41 manual: True
41 manual: True
42
42
43+flag split-these
44+ description: Use split these/semialign packages
45+ manual: False
46+ default: True
47+
43library
48library
44 hs-source-dirs: src
49 hs-source-dirs: src
45 build-depends:
50 build-depends:
@@ -58,21 +63,26 @@ library
58 monoidal-containers >= 0.4 && < 0.6,
63 monoidal-containers >= 0.4 && < 0.6,
59 mtl >= 2.1 && < 2.3,
64 mtl >= 2.1 && < 2.3,
60 prim-uniq >= 0.1.0.1 && < 0.2,
65 prim-uniq >= 0.1.0.1 && < 0.2,
61− primitive >= 0.5 && < 0.7,
66+ primitive >= 0.5 && < 0.8,
62 random == 1.1.*,
67 random == 1.1.*,
63 ref-tf == 0.4.*,
68 ref-tf == 0.4.*,
64 reflection == 2.1.*,
69 reflection == 2.1.*,
65 semigroupoids >= 4.0 && < 6,
70 semigroupoids >= 4.0 && < 6,
66− semigroups >= 0.16 && < 0.19,
71+ semigroups >= 0.16 && < 0.20,
67 stm >= 2.4 && < 2.6,
72 stm >= 2.4 && < 2.6,
68 syb >= 0.5 && < 0.8,
73 syb >= 0.5 && < 0.8,
69− these >= 0.4 && < 0.9,
70 time >= 1.4 && < 1.9,
74 time >= 1.4 && < 1.9,
71 transformers >= 0.2,
75 transformers >= 0.2,
72 transformers-compat >= 0.3,
76 transformers-compat >= 0.3,
73 unbounded-delays >= 0.1.0.0 && < 0.2,
77 unbounded-delays >= 0.1.0.0 && < 0.2,
74 witherable >= 0.2 && < 0.4
78 witherable >= 0.2 && < 0.4
75
79
80+ if flag(split-these)
81+ build-depends: these >= 1 && <1.1,
82+ semialign >=1 && <1.1
83+ else
84+ build-depends: these >= 0.4 && <0.9
85+
76 exposed-modules:
86 exposed-modules:
77 Data.AppendMap,
87 Data.AppendMap,
78 Data.FastMutableIntMap,
88 Data.FastMutableIntMap,
@@ -209,7 +219,8 @@ test-suite hlint
209 , directory
219 , directory
210 , filepath
220 , filepath
211 , filemanip
221 , filemanip
222+ -- newer versions need ghc-lib-parser, and have failing hints
212− , hlint
223+ , hlint <2.1
213 if impl(ghcjs)
224 if impl(ghcjs)
214 buildable: False
225 buildable: False
215
226
@@ -228,6 +239,10 @@ test-suite EventWriterT
228 , transformers
239 , transformers
229 , reflex
240 , reflex
230 , ref-tf
241 , ref-tf
242+
243+ if flag(split-these)
244+ build-depends: these-lens
245+
231 other-modules:
246 other-modules:
232 Reflex.Test
247 Reflex.Test
233 Reflex.TestPlan
248 Reflex.TestPlan
@@ -235,6 +250,7 @@ test-suite EventWriterT
235 Reflex.Plan.Pure
250 Reflex.Plan.Pure
236 Test.Run
251 Test.Run
237
252
253+
238test-suite RequesterT
254test-suite RequesterT
239 type: exitcode-stdio-1.0
255 type: exitcode-stdio-1.0
240 main-is: RequesterT.hs
256 main-is: RequesterT.hs
@@ -250,9 +266,14 @@ test-suite RequesterT
250 , transformers
266 , transformers
251 , reflex
267 , reflex
252 , ref-tf
268 , ref-tf
269+
270+ if flag(split-these)
271+ build-depends: these-lens
272+
253 other-modules:
273 other-modules:
254 Reflex.TestPlan
274 Reflex.TestPlan
255 Reflex.Plan.Pure
275 Reflex.Plan.Pure
276+ Test.Run
256
277
257test-suite QueryT
278test-suite QueryT
258 type: exitcode-stdio-1.0
279 type: exitcode-stdio-1.0
@@ -271,6 +292,10 @@ test-suite QueryT
271 , semigroups
292 , semigroups
272 , these
293 , these
273 , transformers
294 , transformers
295+
296+ if flag(split-these)
297+ build-depends: semialign, these-lens
298+
274 other-modules:
299 other-modules:
275 Test.Run
300 Test.Run
276 Reflex.TestPlan
301 Reflex.TestPlan
@@ -291,6 +316,10 @@ test-suite GC-Semantics
291 , transformers
316 , transformers
292 , reflex
317 , reflex
293 , ref-tf
318 , ref-tf
319+
320+ if flag(split-these)
321+ build-depends: semialign
322+
294 if impl(ghc < 8)
323 if impl(ghc < 8)
295 build-depends: semigroups
324 build-depends: semigroups
296 other-modules:
325 other-modules:
src/Reflex/Class.hs+12
@@ -173,6 +173,14 @@ module Reflex.Class
173 , slowHeadE
173 , slowHeadE
174 ) where
174 ) where
175
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+
176import Control.Applicative
184import Control.Applicative
177import Control.Monad.Identity
185import Control.Monad.Identity
178import Control.Monad.Reader
186import Control.Monad.Reader
@@ -1063,6 +1071,10 @@ instance Reflex t => Align (Event t) where
1063instance Reflex t => Semialign (Event t) where
1071instance Reflex t => Semialign (Event t) where
1064#endif
1072#endif
1065 align = alignEventWithMaybe Just
1073 align = alignEventWithMaybe Just
1074+
1075+#if defined(MIN_VERSION_semialign)
1076+ zip x y = mapMaybe justThese $ align x y
1077+#endif
1066
1078
1067
1079
1068-- | Create a new 'Event' that only occurs if the supplied 'Event' occurs and
1080-- | Create a new 'Event' that only occurs if the supplied 'Event' occurs and
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/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/Profiled.hs+3−3
@@ -79,9 +79,9 @@ getCostCentreStack = go []
79 go (cc : l) parent
79 go (cc : l) parent
80
80
81toCostCentreTree :: Ptr CostCentreStack -> Int -> IO CostCentreTree
81toCostCentreTree :: Ptr CostCentreStack -> Int -> IO CostCentreTree
82−toCostCentreTree ccs n = do
82+toCostCentreTree ccs n =
83− ccList <- getCostCentreStack ccs
84− return $ foldr (\cc child -> CostCentreTree 0 n $ Map.singleton cc child) (CostCentreTree n n mempty) ccList
83+ foldr (\cc child -> CostCentreTree 0 n $ Map.singleton cc child) (CostCentreTree n n mempty)
84+ <$> getCostCentreStack ccs
85
85
86getCostCentreTree :: IO CostCentreTree
86getCostCentreTree :: IO CostCentreTree
87getCostCentreTree = do
87getCostCentreTree = 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/Spider/Internal.hs+10
@@ -68,6 +68,12 @@ import System.IO.Unsafe
68import System.Mem.Weak
68import System.Mem.Weak
69import Unsafe.Coerce
69import Unsafe.Coerce
70
70
71+#if defined(MIN_VERSION_semialign)
72+#if MIN_VERSION_these(0,8,0)
73+import Data.These.Combinators (justThese)
74+#endif
75+#endif
76+
71#ifdef DEBUG_CYCLES
77#ifdef DEBUG_CYCLES
72import Control.Monad.State hiding (forM, forM_, mapM, mapM_, sequence)
78import Control.Monad.State hiding (forM, forM_, mapM, mapM_, sequence)
73import Data.List.NonEmpty (NonEmpty (..), nonEmpty)
79import Data.List.NonEmpty (NonEmpty (..), nonEmpty)
@@ -1139,6 +1145,10 @@ instance HasSpiderTimeline x => Semialign (Event x) where
1139 align ea eb = mapMaybe dmapToThese $ mergeG coerce $ dynamicConst $
1145 align ea eb = mapMaybe dmapToThese $ mergeG coerce $ dynamicConst $
1140 DMap.fromDistinctAscList [LeftTag :=> ea, RightTag :=> eb]
1146 DMap.fromDistinctAscList [LeftTag :=> ea, RightTag :=> eb]
1141
1147
1148+#if defined(MIN_VERSION_semialign)
1149+ zip x y = mapMaybe justThese $ align x y
1150+#endif
1151+
1142data DynType x p = UnsafeDyn !(BehaviorM x (PatchTarget p), Event x p)
1152data DynType x p = UnsafeDyn !(BehaviorM x (PatchTarget p), Event x p)
1143 | BuildDyn !(EventM x (PatchTarget p), Event x p)
1153 | BuildDyn !(EventM x (PatchTarget p), Event x p)
1144 | HoldDyn !(Hold x p)
1154 | HoldDyn !(Hold x p)