@@ -34,10 +34,9 @@ module Reflex.Class
3434 , coerceDynamic
3535 , MonadSample (..)
3636 , MonadHold (..)
37− -- ** 'fan'-related types
37+ -- ** 'fan' related types
3838 , EventSelector (..)
3939 , EventSelectorInt (..)
40− -- ** 'Incremental'-related types
4140 -- * Convenience functions
4241 , constDyn
4342 , pushAlways
@@ -201,7 +200,7 @@ import qualified Reflex.Patch.MapWithMove as PatchMapWithMove
201200import Debug.Trace (trace)
202201
203202-- | The 'Reflex' class contains all the primitive functionality needed for
204−-- Functional Reactive Programming (FRP). The @t@ type parameter indicates
203+-- Functional Reactive Programming (FRP). The @/t/@ type parameter indicates
205204-- which "timeline" is in use. Timelines are fully-independent FRP contexts,
206205-- and the type of the timeline determines the FRP engine to be used. For most
207206-- purposes, the 'Reflex.Spider' implementation is recommended.
@@ -267,7 +266,7 @@ class ( MonadHold t (PushM t)
267266 -- | Create a new 'Dynamic'. The given 'PullM' must always return the most
268267 -- recent firing of the given 'Event', if any.
269268 unsafeBuildDynamic :: PullM t a -> Event t a -> Dynamic t a
270− -- | Create a new 'Incremental'. The given 'PullM''s value must always change
269+ -- | Create a new 'Incremental'. The given "PullM"'s value must always change
271270 -- in the same way that the accumulated application of patches would change
272271 -- that value.
273272 unsafeBuildIncremental :: Patch p => PullM t (PatchTarget p) -> Event t p -> Incremental t p
@@ -310,7 +309,7 @@ coerceDynamic :: (Reflex t, Coercible a b) => Dynamic t a -> Dynamic t b
310309coerceDynamic = coerceWith $ dynamicCoercion Coercion
311310
312311-- | Construct a 'Dynamic' from a 'Behavior' and an 'Event'. The 'Behavior'
313−-- _must_ change when and only when the 'Event' fires, such that the
312+-- __must__ change when and only when the 'Event' fires, such that the
314313-- 'Behavior''s value is always equal to the most recent firing of the 'Event';
315314-- if this is not the case, the resulting 'Dynamic' will behave
316315-- nondeterministically.
@@ -338,7 +337,7 @@ class MonadSample t m => MonadHold t m where
338337 -- value and will be updated whenever the given 'Event' occurs. The update
339338 -- takes effect immediately after the 'Event' occurs; if the occurrence that
340339 -- sets the 'Behavior' (or one that is simultaneous with it) is used to sample
341− -- the 'Behavior', it will see the _old_ value of the 'Behavior', not the new
340+ -- the 'Behavior', it will see the __old__ value of the 'Behavior', not the new
342341 -- one.
343342 hold :: a -> Event t a -> m (Behavior t a)
344343 default hold :: (m ~ f m', MonadTrans f, MonadHold t m') => a -> Event t a -> m (Behavior t a)
@@ -641,7 +640,7 @@ headTailE e = do
641640-- event returns 'True'.
642641--
643642-- Starting at the current time, fire all the occurrences of the 'Event' for
644−-- which the given predicate returns 'True'. When 'False' first is returned,
643+-- which the given predicate returns 'True'. When first 'False' is returned,
645644-- do not fire, and permanently stop firing, even if 'True' values would have
646645-- been encountered later.
647646takeWhileE
@@ -656,7 +655,7 @@ takeWhileE f = takeWhileJustE $ \v -> guard (f v) $> v
656655-- event returns 'Just b'.
657656--
658657-- Starting at the current time, fire all the occurrences of the 'Event' for
659−-- which the given predicate returns 'Just b'. When 'Nothing' first is returned,
658+-- which the given predicate returns 'Just b'. When first 'Nothing' is returned,
660659-- do not fire, and permanently stop firing, even if 'Just b' values would have
661660-- been encountered later.
662661takeWhileJustE
@@ -829,7 +828,7 @@ fanMap = fan . fmap mapToDMap
829828
830829-- | Switches to the new event whenever it receives one. Only the old event is
831830-- considered the moment a new one is switched in; the output event will fire at
832−-- that moment if only if the old event does.
831+-- that moment only if the old event does.
833832--
834833-- Because the simultaneous firing case is irrelevant, this function imposes
835834-- laxer "timing requirements" on the overall circuit, avoiding many potential
@@ -875,13 +874,13 @@ coincidencePatchMap e = fmapCheap PatchMap $ coincidence $ ffor e $ \(PatchMap m
875874 Nothing -> fmapCheap (const Nothing) e
876875 Just ev -> leftmost [fmapCheap Just ev, fmapCheap (const Nothing) e]
877876
878−-- | See 'coincicencePatchMap'
877+-- | See 'coincidencePatchMap'
879878coincidencePatchIntMap :: Reflex t => Event t (PatchIntMap (Event t v)) -> Event t (PatchIntMap v)
880879coincidencePatchIntMap e = fmapCheap PatchIntMap $ coincidence $ ffor e $ \(PatchIntMap m) -> mergeIntMap $ ffor m $ \case
881880 Nothing -> fmapCheap (const Nothing) e
882881 Just ev -> leftmost [fmapCheap Just ev, fmapCheap (const Nothing) e]
883882
884−-- | See 'coincicencePatchMap'
883+-- | See 'coincidencePatchMap'
885884coincidencePatchMapWithMove :: (Reflex t, Ord k) => Event t (PatchMapWithMove k (Event t v)) -> Event t (PatchMapWithMove k v)
886885coincidencePatchMapWithMove e = fmapCheap unsafePatchMapWithMove $ coincidence $ ffor e $ \p -> mergeMap $ ffor (unPatchMapWithMove p) $ \ni -> case PatchMapWithMove._nodeInfo_from ni of
887886 PatchMapWithMove.From_Delete -> fforCheap e $ \_ ->
@@ -942,7 +941,7 @@ zipDyn = zipDynWith (,)
942941
943942-- | Combine two 'Dynamic's with a combining function. The result will change
944943-- whenever either (or both) input 'Dynamic' changes.
945−-- More efficient than liftA2.
944+-- More efficient than 'liftA2'.
946945zipDynWith :: Reflex t => (a -> b -> c) -> Dynamic t a -> Dynamic t b -> Dynamic t c
947946zipDynWith f da db =
948947 let eab = align (updated da) (updated db)
@@ -973,7 +972,7 @@ instance (Reflex t, Monoid a) => Monoid (Dynamic t a) where
973972
974973-- | This function converts a 'DMap' whose elements are 'Dynamic's into a
975974-- 'Dynamic' 'DMap'. Its implementation is more efficient than doing the same
976−-- through the use of multiple uses of 'zipWithDyn' or 'Applicative' operators.
975+-- through the use of multiple uses of 'zipDynWith' or 'Applicative' operators.
977976distributeDMapOverDynPure :: forall t k. (Reflex t, GCompare k) => DMap k (Dynamic t) -> Dynamic t (DMap k Identity)
978977distributeDMapOverDynPure dm = case DMap.toList dm of
979978 [] -> constDyn DMap.empty