on develop help sign in
Fixups for GHC 7.8
commit18b2cadc83e92e48cae77f06005371f678d2b3c8 authorRyan Trinkle <ryan.trinkle@gmail.com> dateMon 18 Jul 2016, 10:05 (10 years ago) parent8182a75
1 file changed+12−3
src/Reflex/Class.hs+12−3
src/Reflex/Class.hs+12−3
@@ -46,7 +46,15 @@ import Prelude hiding (foldl, mapM, mapM_, sequence, sequence_)
4646
4747import Debug.Trace (trace)
4848
49−class (MonadHold t (PushM t), MonadSample t (PullM t), MonadFix (PushM t), Functor (Event t), Functor (Behavior t), Functor (Dynamic t), Monad (Dynamic t)) => Reflex t where
49+class ( MonadHold t (PushM t)
50+ , MonadSample t (PullM t)
51+ , MonadFix (PushM t)
52+ , Functor (Event t)
53+ , Functor (Behavior t)
54+ , Functor (Dynamic t)
55+ , Applicative (Dynamic t) -- ^ Necessary for GHC <=7.8
56+ , Monad (Dynamic t)
57+ ) => Reflex t where
5058 -- | A container for a value that can change over time. Behaviors can be sampled at will, but it is not possible to be notified when they change
5159 data Behavior t :: * -> *
5260 -- | A stream of occurrences. During any given frame, an Event is either occurring or not occurring; if it is occurring, it will contain a value of the given type (its "occurrence type")
@@ -393,11 +401,12 @@ appendEvents :: (Reflex t, Monoid a) => Event t a -> Event t a -> Event t a
393401appendEvents e1 e2 = mergeThese mappend <$> align e1 e2
394402
395403{-# DEPRECATED sequenceThese "Use bisequenceA or bisequence from the bifunctors package instead" #-}
404+{-# ANN sequenceThese "HLint: ignore Use fmap" #-}
396405sequenceThese :: Monad m => These (m a) (m b) -> m (These a b)
397406sequenceThese t = case t of
398− This ma -> fmap This ma
407+ This ma -> liftM This ma
399408 These ma mb -> liftM2 These ma mb
400− That mb -> fmap That mb
409+ That mb -> liftM That mb
401410
402411instance (Semigroup a, Reflex t) => Semigroup (Event t a) where
403412 (<>) = alignWith (mergeThese (<>))