on develop help sign in
Add -fwarn-redundant-constraints
commitb24a09b445cf599b5e41a5a2bbf33d84df6baeb1 authorRyan Trinkle <ryan.trinkle@gmail.com> dateSat 14 Jul 2018, 14:03 (8 years ago) parent0cebaae
9 files changed+29−29
reflex.cabal+1−1 src/Data/AppendMap.hs+3−3 src/Reflex/Class.hs+3−3 src/Reflex/EventWriter/Base.hs+6−6 src/Reflex/Network.hs+3−3 src/Reflex/Patch/DMapWithMove.hs+3−3 src/Reflex/PerformEvent/Base.hs+3−3 src/Reflex/Requester/Base.hs+2−2 src/Reflex/Spider/Internal.hs+5−5
reflex.cabal+1−1
@@ -111,7 +111,7 @@ library
111111 Reflex.Widget.Basic,
112112 Reflex.Workflow
113113
114− ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2 -fspecialise-aggressively -ddump-simpl -ddump-to-file -dsuppress-coercions -dsuppress-idinfo
114+ ghc-options: -Wall -fwarn-redundant-constraints -fwarn-tabs -funbox-strict-fields -O2 -fspecialise-aggressively -ddump-simpl -ddump-to-file -dsuppress-coercions -dsuppress-idinfo
115115 ghc-prof-options: -fprof-auto
116116
117117 if flag(debug-trace-events)
src/Data/AppendMap.hs+3−3
@@ -197,7 +197,7 @@ foldlWithKey :: forall k a b. (a -> k -> b -> a) -> a -> MonoidalMap k b -> a
197197foldlWithKey = coerce (Map.foldlWithKey :: (a -> k -> b -> a) -> a -> Map k b -> a)
198198
199199foldMapWithKey :: forall k a m. Monoid m => (k -> a -> m) -> MonoidalMap k a -> m
200−foldMapWithKey = coerce (Map.foldMapWithKey :: Monoid m => (k -> a -> m) -> Map k a -> m)
200+foldMapWithKey = coerce (Map.foldMapWithKey :: (k -> a -> m) -> Map k a -> m)
201201
202202foldr' :: forall k a b. (a -> b -> b) -> b -> MonoidalMap k a -> b
203203foldr' = coerce (Map.foldr' :: (a -> b -> b) -> b -> Map k a -> b)
@@ -350,13 +350,13 @@ maxViewWithKey :: forall k a. MonoidalMap k a -> Maybe ((k, a), MonoidalMap k a)
350350maxViewWithKey = coerce (Map.maxViewWithKey :: Map k a -> Maybe ((k, a), Map k a))
351351
352352showTree :: forall k a. (Show k, Show a) => MonoidalMap k a -> String
353−showTree = coerce (Map.showTree :: (Show k, Show a) => Map k a -> String)
353+showTree = coerce (Map.showTree :: Map k a -> String)
354354
355355showTreeWith :: forall k a. (k -> a -> String) -> Bool -> Bool -> MonoidalMap k a -> String
356356showTreeWith = coerce (Map.showTreeWith :: (k -> a -> String) -> Bool -> Bool -> Map k a -> String)
357357
358358valid :: forall k a. Ord k => MonoidalMap k a -> Bool
359−valid = coerce (Map.valid :: Ord k => Map k a -> Bool)
359+valid = coerce (Map.valid :: Map k a -> Bool)
360360
361361instance Default (MonoidalMap k a) where
362362 def = empty
src/Reflex/Class.hs+3−3
@@ -561,13 +561,13 @@ attachWithMaybe f b e = flip push e $ \o -> (`f` o) <$> sample b
561561
562562-- | Create a new 'Event' that occurs on all but the first occurence of the
563563-- supplied 'Event'.
564−tailE :: (Reflex t, MonadHold t m, MonadFix m) => Event t a -> m (Event t a)
564+tailE :: (Reflex t, MonadHold t m) => Event t a -> m (Event t a)
565565tailE e = snd <$> headTailE e
566566
567567-- | Create a tuple of two 'Event's with the first one occuring only the first
568568-- time the supplied 'Event' occurs and the second occuring on all but the first
569569-- occurence.
570−headTailE :: (Reflex t, MonadHold t m, MonadFix m) => Event t a -> m (Event t a, Event t a)
570+headTailE :: (Reflex t, MonadHold t m) => Event t a -> m (Event t a, Event t a)
571571headTailE e = do
572572 eHead <- headE e
573573 be <- hold never $ fmap (const e) eHead
@@ -1162,7 +1162,7 @@ appendEvents = alignWith $ mergeThese mappend
11621162
11631163-- | Alias for 'headE'
11641164{-# DEPRECATED onceE "Use 'headE' instead" #-}
1165−onceE :: (Reflex t, MonadHold t m, MonadFix m) => Event t a -> m (Event t a)
1165+onceE :: MonadHold t m => Event t a -> m (Event t a)
11661166onceE = headE
11671167
11681168-- | Run both sides of a 'These' monadically, combining the results.
src/Reflex/EventWriter/Base.hs+6−6
@@ -161,7 +161,7 @@ runWithReplaceEventWriterTWith f a0 a' = do
161161 return (fst result0, fmapCheap fst result')
162162
163163-- | Like 'runWithReplaceEventWriterTWith', but for 'sequenceIntMapWithAdjust'.
164−sequenceIntMapWithAdjustEventWriterTWith :: forall t m p w v v'. (Reflex t, MonadHold t m, Semigroup w, Semigroup w, Functor p, Patch (p (Event t w)), PatchTarget (p (Event t w)) ~ IntMap (Event t w))
164+sequenceIntMapWithAdjustEventWriterTWith :: forall t m p w v v'. (Reflex t, MonadHold t m, Semigroup w, Functor p, Patch (p (Event t w)), PatchTarget (p (Event t w)) ~ IntMap (Event t w))
165165 => ( (IntMap.Key -> v -> m (Event t w, v'))
166166 -> IntMap v
167167 -> Event t (p v)
@@ -269,7 +269,7 @@ instance (MonadQuery t q m, Monad m) => MonadQuery t q (EventWriterT t w m) wher
269269 queryIncremental = lift . queryIncremental
270270
271271-- | Map a function over the output of a 'EventWriterT'.
272−withEventWriterT :: (Semigroup w, Semigroup w', Reflex t, MonadHold t m, MonadFix m)
272+withEventWriterT :: (Semigroup w, Semigroup w', Reflex t, MonadHold t m)
273273 => (w -> w')
274274 -> EventWriterT t w m a
275275 -> EventWriterT t w' m a
@@ -282,8 +282,8 @@ withEventWriterT f ew = do
282282 return r
283283
284284-- | Change the monad underlying an EventWriterT
285−mapEventWriterT :: (Semigroup w, Reflex t, MonadHold t m, MonadFix m)
286− => (forall x. m x -> n x)
287− -> EventWriterT t w m a
288− -> EventWriterT t w n a
285+mapEventWriterT
286+ :: (forall x. m x -> n x)
287+ -> EventWriterT t w m a
288+ -> EventWriterT t w n a
289289mapEventWriterT f (EventWriterT a) = EventWriterT $ mapStateT f a
src/Reflex/Network.hs+3−3
@@ -16,7 +16,7 @@ import Reflex.PostBuild.Class
1616-- | Given a Dynamic of network-creating actions, create a network that is recreated whenever the Dynamic updates.
1717-- The returned Event of network results occurs when the Dynamic does.
1818-- Note: Often, the type 'a' is an Event, in which case the return value is an Event-of-Events that would typically be flattened (via 'switchPromptly').
19−networkView :: (Reflex t, NotReady t m, Adjustable t m, PostBuild t m) => Dynamic t (m a) -> m (Event t a)
19+networkView :: (NotReady t m, Adjustable t m, PostBuild t m) => Dynamic t (m a) -> m (Event t a)
2020networkView child = do
2121 postBuild <- getPostBuild
2222 let newChild = leftmost [updated child, tagCheap (current child) postBuild]
@@ -25,14 +25,14 @@ networkView child = do
2525-- | Given an initial network and an Event of network-creating actions, create a network that is recreated whenever the Event fires.
2626-- The returned Dynamic of network results occurs when the Event does.
2727-- Note: Often, the type 'a' is an Event, in which case the return value is a Dynamic-of-Events that would typically be flattened.
28−networkHold :: (Reflex t, Adjustable t m, MonadHold t m) => m a -> Event t (m a) -> m (Dynamic t a)
28+networkHold :: (Adjustable t m, MonadHold t m) => m a -> Event t (m a) -> m (Dynamic t a)
2929networkHold child0 newChild = do
3030 (result0, newResult) <- runWithReplace child0 newChild
3131 holdDyn result0 newResult
3232
3333-- | Render a placeholder network to be shown while another network is not yet
3434-- done building
35−untilReady :: (Reflex t, Adjustable t m, PostBuild t m) => m a -> m b -> m (a, Event t b)
35+untilReady :: (Adjustable t m, PostBuild t m) => m a -> m b -> m (a, Event t b)
3636untilReady a b = do
3737 postBuild <- getPostBuild
3838 runWithReplace a $ b <$ postBuild
src/Reflex/Patch/DMapWithMove.hs+3−3
@@ -70,11 +70,11 @@ data From (k :: a -> *) (v :: a -> *) :: a -> * where
7070type To = ComposeMaybe
7171
7272-- |Test whether a 'PatchDMapWithMove' satisfies its invariants.
73−validPatchDMapWithMove :: forall k v. (GCompare k, GEq k, GShow k) => DMap k (NodeInfo k v) -> Bool
73+validPatchDMapWithMove :: forall k v. (GCompare k, GShow k) => DMap k (NodeInfo k v) -> Bool
7474validPatchDMapWithMove = not . null . validationErrorsForPatchDMapWithMove
7575
7676-- |Enumerate what reasons a 'PatchDMapWithMove' doesn't satisfy its invariants, returning @[]@ if it's valid.
77−validationErrorsForPatchDMapWithMove :: forall k v. (GCompare k, GEq k, GShow k) => DMap k (NodeInfo k v) -> [String]
77+validationErrorsForPatchDMapWithMove :: forall k v. (GCompare k, GShow k) => DMap k (NodeInfo k v) -> [String]
7878validationErrorsForPatchDMapWithMove m =
7979 noSelfMoves <> movesBalanced
8080 where
@@ -268,7 +268,7 @@ unsafePatchDMapWithMove = PatchDMapWithMove
268268
269269-- |Wrap a 'DMap' representing patch changes into a 'PatchDMapWithMove' while checking invariants. If the invariants are satisfied, @Right p@ is returned
270270-- otherwise @Left errors@.
271−patchDMapWithMove :: (GCompare k, GEq k, GShow k) => DMap k (NodeInfo k v) -> Either [String] (PatchDMapWithMove k v)
271+patchDMapWithMove :: (GCompare k, GShow k) => DMap k (NodeInfo k v) -> Either [String] (PatchDMapWithMove k v)
272272patchDMapWithMove dm =
273273 case validationErrorsForPatchDMapWithMove dm of
274274 [] -> Right $ unsafePatchDMapWithMove dm
src/Reflex/PerformEvent/Base.hs+3−3
@@ -60,14 +60,14 @@ deriving instance ReflexHost t => Monad (PerformEventT t m)
6060deriving instance ReflexHost t => MonadFix (PerformEventT t m)
6161deriving instance (ReflexHost t, MonadIO (HostFrame t)) => MonadIO (PerformEventT t m)
6262deriving instance (ReflexHost t, MonadException (HostFrame t)) => MonadException (PerformEventT t m)
63−deriving instance (ReflexHost t, Applicative m, Monoid a) => Monoid (PerformEventT t m a)
64−deriving instance (ReflexHost t, Applicative m, S.Semigroup a) => S.Semigroup (PerformEventT t m a)
63+deriving instance (ReflexHost t, Monoid a) => Monoid (PerformEventT t m a)
64+deriving instance (ReflexHost t, S.Semigroup a) => S.Semigroup (PerformEventT t m a)
6565
6666instance (PrimMonad (HostFrame t), ReflexHost t) => PrimMonad (PerformEventT t m) where
6767 type PrimState (PerformEventT t m) = PrimState (HostFrame t)
6868 primitive = PerformEventT . lift . primitive
6969
70−instance (ReflexHost t, Ref m ~ Ref IO, PrimMonad (HostFrame t)) => PerformEvent t (PerformEventT t m) where
70+instance (ReflexHost t, Ref m ~ Ref IO) => PerformEvent t (PerformEventT t m) where
7171 type Performable (PerformEventT t m) = HostFrame t
7272 {-# INLINABLE performEvent_ #-}
7373 performEvent_ = PerformEventT . requesting_
src/Reflex/Requester/Base.hs+2−2
@@ -280,7 +280,7 @@ tagRequest req = do
280280 return t
281281
282282{-# INLINE responseFromTag #-}
283−responseFromTag :: (Monad m, Reflex t) => MyTagWrap response (Entry response x) -> RequesterT t request response m (Event t (Entry response x))
283+responseFromTag :: Monad m => MyTagWrap response (Entry response x) -> RequesterT t request response m (Event t (Entry response x))
284284responseFromTag (MyTagWrap t) = do
285285 responses :: EventSelectorInt t Any <- RequesterT ask
286286 return $ (unsafeCoerce :: Event t Any -> Event t (Entry response x)) $ selectInt responses t
@@ -315,7 +315,7 @@ instance (Reflex t, Adjustable t m, MonadHold t m, MonadFix m) => Adjustable t (
315315 traverseDMapWithKeyWithAdjust = traverseDMapWithKeyWithAdjustRequesterTWith (\f dm0 dm' -> lift $ traverseDMapWithKeyWithAdjust f dm0 dm') mapPatchDMap weakenPatchDMapWith patchMapNewElementsMap mergeMapIncremental
316316 traverseDMapWithKeyWithAdjustWithMove = traverseDMapWithKeyWithAdjustRequesterTWith (\f dm0 dm' -> lift $ traverseDMapWithKeyWithAdjustWithMove f dm0 dm') mapPatchDMapWithMove weakenPatchDMapWithMoveWith patchMapWithMoveNewElementsMap mergeMapIncrementalWithMove
317317
318−requesting' :: (MyTagTypeOffset x, Monad m, Reflex t) => Event t (Entry request x) -> RequesterT t request response m (Event t (Entry response x))
318+requesting' :: (MyTagTypeOffset x, Monad m) => Event t (Entry request x) -> RequesterT t request response m (Event t (Entry response x))
319319requesting' = responseFromTag . castMyTagWrap <=< tagRequest
320320
321321{-# INLINABLE runWithReplaceRequesterTWith #-}
src/Reflex/Spider/Internal.hs+5−5
@@ -235,7 +235,7 @@ subscribeAndRead = unEvent
235235-- caching; if the computation function is very cheap, this is (much) more
236236-- efficient than 'push'
237237{-# INLINE [1] pushCheap #-}
238−pushCheap :: HasSpiderTimeline x => (a -> ComputeM x (Maybe b)) -> Event x a -> Event x b
238+pushCheap :: (a -> ComputeM x (Maybe b)) -> Event x a -> Event x b
239239pushCheap !f e = Event $ \sub -> do
240240 (subscription, occ) <- subscribeAndRead e $ sub
241241 { subscriberPropagate = \a -> do
@@ -379,7 +379,7 @@ eventSwitch !s = Event $ wrap eventSubscribedSwitch $ getSwitchSubscribed s
379379eventCoincidence :: HasSpiderTimeline x => Coincidence x a -> Event x a
380380eventCoincidence !c = Event $ wrap eventSubscribedCoincidence $ getCoincidenceSubscribed c
381381
382−eventHold :: HasSpiderTimeline x => Hold x p -> Event x p
382+eventHold :: Hold x p -> Event x p
383383eventHold !h = Event $ subscribeHoldEvent h
384384
385385eventDyn :: (HasSpiderTimeline x, Patch p) => Dyn x p -> Event x p
@@ -636,7 +636,7 @@ walkInvalidHeightParents s0 = do
636636#endif
637637
638638{-# INLINE subscribeHoldEvent #-}
639−subscribeHoldEvent :: HasSpiderTimeline x => Hold x p -> Subscriber x p -> EventM x (EventSubscription x, Maybe p)
639+subscribeHoldEvent :: Hold x p -> Subscriber x p -> EventM x (EventSubscription x, Maybe p)
640640subscribeHoldEvent = subscribeAndRead . holdEvent
641641
642642--------------------------------------------------------------------------------
@@ -708,13 +708,13 @@ data Dynamic x p = Dynamic
708708 , dynamicUpdated :: !(Event x p)
709709 }
710710
711−dynamicHold :: HasSpiderTimeline x => Hold x p -> Dynamic x p
711+dynamicHold :: Hold x p -> Dynamic x p
712712dynamicHold !h = Dynamic
713713 { dynamicCurrent = behaviorHold h
714714 , dynamicUpdated = eventHold h
715715 }
716716
717−dynamicHoldIdentity :: HasSpiderTimeline x => Hold x (Identity a) -> Dynamic x (Identity a)
717+dynamicHoldIdentity :: Hold x (Identity a) -> Dynamic x (Identity a)
718718dynamicHoldIdentity = dynamicHold
719719
720720dynamicConst :: PatchTarget p -> Dynamic x p