on develop help sign in
DRY conditional compilation
commite6d87148fe71fb9d7e67a47a59e7028334775838 authorAlexandre Esteves <alexandre.fmp.esteves@gmail.com> dateThu 18 Apr 2019, 02:20 (7 years ago) parent9ec0e5f
2 files changed+6−14
src/Reflex/Class.hs+3−7 src/Reflex/Spider/Internal.hs+3−7
src/Reflex/Class.hs+3−7
@@ -1018,17 +1018,13 @@ switchHoldPromptOnlyIncremental mergePatchIncremental coincidencePatch e0 e' = d
10181018 That new -> new `applyAlways` mempty
10191019 These old new -> new `applyAlways` old
10201020
1021+instance Reflex t => Align (Event t) where
1022+ nil = never
10211023#if MIN_VERSION_these(0, 8, 0)
10221024instance Reflex t => Semialign (Event t) where
1025+#endif
10231026 align = alignEventWithMaybe Just
10241027
1025−instance Reflex t => Align (Event t) where
1026− nil = never
1027−#else
1028−instance Reflex t => Align (Event t) where
1029− align = alignEventWithMaybe Just
1030− nil = never
1031−#endif
10321028
10331029-- | Create a new 'Event' that only occurs if the supplied 'Event' occurs and
10341030-- the 'Behavior' is true at the time of occurrence.
src/Reflex/Spider/Internal.hs+3−7
@@ -1131,16 +1131,12 @@ newInvalidatorPull p = return $! InvalidatorPull p
11311131instance HasSpiderTimeline x => Filterable (Event x) where
11321132 mapMaybe f = push $ return . f
11331133
1134−#if MIN_VERSION_these(0, 8, 0)
1135−instance HasSpiderTimeline x => Semialign (Event x) where
1136− align ea eb = mapMaybe dmapToThese $ merge $ dynamicConst $ DMap.fromDistinctAscList [LeftTag :=> ea, RightTag :=> eb]
1137−instance HasSpiderTimeline x => Align (Event x) where
1138− nil = eventNever
1139−#else
11401134instance HasSpiderTimeline x => Align (Event x) where
11411135 nil = eventNever
1142− align ea eb = mapMaybe dmapToThese $ merge $ dynamicConst $ DMap.fromDistinctAscList [LeftTag :=> ea, RightTag :=> eb]
1136+#if MIN_VERSION_these(0, 8, 0)
1137+instance HasSpiderTimeline x => Semialign (Event x) where
11431138#endif
1139+ align ea eb = mapMaybe dmapToThese $ merge $ dynamicConst $ DMap.fromDistinctAscList [LeftTag :=> ea, RightTag :=> eb]
11441140
11451141data DynType x p = UnsafeDyn !(BehaviorM x (PatchTarget p), Event x p)
11461142 | BuildDyn !(EventM x (PatchTarget p), Event x p)