on develop help sign in
DRY conditional compilation
e6d8714Alexandre Esteves
src/Reflex/Class.hs+3−7
@@ -1018,17 +1018,13 @@ switchHoldPromptOnlyIncremental mergePatchIncremental coincidencePatch e0 e' = d
1018 That new -> new `applyAlways` mempty
1018 That new -> new `applyAlways` mempty
1019 These old new -> new `applyAlways` old
1019 These old new -> new `applyAlways` old
1020
1020
1021+instance Reflex t => Align (Event t) where
1022+ nil = never
1021#if MIN_VERSION_these(0, 8, 0)
1023#if MIN_VERSION_these(0, 8, 0)
1022instance Reflex t => Semialign (Event t) where
1024instance Reflex t => Semialign (Event t) where
1025+#endif
1023 align = alignEventWithMaybe Just
1026 align = alignEventWithMaybe Just
1024
1027
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
1032
1028
1033-- | Create a new 'Event' that only occurs if the supplied 'Event' occurs and
1029-- | Create a new 'Event' that only occurs if the supplied 'Event' occurs and
1034-- the 'Behavior' is true at the time of occurrence.
1030-- 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
1131instance HasSpiderTimeline x => Filterable (Event x) where
1131instance HasSpiderTimeline x => Filterable (Event x) where
1132 mapMaybe f = push $ return . f
1132 mapMaybe f = push $ return . f
1133
1133
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
1140instance HasSpiderTimeline x => Align (Event x) where
1134instance HasSpiderTimeline x => Align (Event x) where
1141 nil = eventNever
1135 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
1143#endif
1138#endif
1139+ align ea eb = mapMaybe dmapToThese $ merge $ dynamicConst $ DMap.fromDistinctAscList [LeftTag :=> ea, RightTag :=> eb]
1144
1140
1145data DynType x p = UnsafeDyn !(BehaviorM x (PatchTarget p), Event x p)
1141data DynType x p = UnsafeDyn !(BehaviorM x (PatchTarget p), Event x p)
1146 | BuildDyn !(EventM x (PatchTarget p), Event x p)
1142 | BuildDyn !(EventM x (PatchTarget p), Event x p)