on develop help sign in
Expose alignEventWithMaybe
commitdb1dd70e38c97df060c3e3d7ac773f2a87712dce authorRyan Trinkle <ryan.trinkle@gmail.com> dateThu 9 Mar 2017, 13:24 (10 years ago) parentd78ba43
1 file changed+5−6
src/Reflex/Class.hs+5−6
src/Reflex/Class.hs+5−6
@@ -47,6 +47,7 @@ module Reflex.Class
4747 , mergeList
4848 , mergeWith
4949 , difference
50+ , alignEventWithMaybe
5051 -- ** Breaking up 'Event's
5152 , splitE
5253 , fanEither
@@ -751,7 +752,7 @@ switchPromptOnly e0 e' = do
751752
752753instance Reflex t => Align (Event t) where
753754 nil = never
754− align = alignWithMaybe Just
755+ align = alignEventWithMaybe Just
755756
756757-- | Create a new 'Event' that only occurs if the supplied 'Event' occurs and
757758-- the 'Behavior' is true at the time of occurence.
@@ -818,14 +819,12 @@ distributeListOverDynWith f = fmap (f . map (\(Const2 _ :=> Identity v) -> v) .
818819-- | Create a new 'Event' that occurs when the first supplied 'Event' occurs
819820-- unless the second supplied 'Event' occurs simultaneously.
820821difference :: Reflex t => Event t a -> Event t b -> Event t a
821−difference = alignWithMaybe $ \case
822+difference = alignEventWithMaybe $ \case
822823 This a -> Just a
823824 _ -> Nothing
824825
825−-- (intentially not exported, for now)
826−alignWithMaybe
827− :: Reflex t => (These a b -> Maybe c) -> Event t a -> Event t b -> Event t c
828−alignWithMaybe f ea eb =
826+alignEventWithMaybe :: Reflex t => (These a b -> Maybe c) -> Event t a -> Event t b -> Event t c
827+alignEventWithMaybe f ea eb =
829828 fmapMaybe (f <=< dmapToThese)
830829 $ merge
831830 $ DMap.fromList [LeftTag :=> ea, RightTag :=> eb]