on develop help sign in
Merge pull request #257 from reflex-frp/dn-haddock-fixes
29ed3c1Luigy Leon
src/Data/FastWeakBag.hs+2−2
@@ -42,8 +42,8 @@ import Data.IORef
42import System.Mem.Weak
42import System.Mem.Weak
43#endif
43#endif
44
44
45−-- | A @FastWeakBag a@ holds a set of values of type @a@, but does not retain them -
45+-- | A 'FastWeakBag' holds a set of values of type @/a/@, but does not retain them -
46−-- that is, they can still be garbage-collected. As long as the @a@s remain
46+-- that is, they can still be garbage-collected. As long as the @/a/@ values remain
47-- alive, the 'FastWeakBag' will continue to refer to them.
47-- alive, the 'FastWeakBag' will continue to refer to them.
48#ifdef GHCJS_FAST_WEAK
48#ifdef GHCJS_FAST_WEAK
49newtype FastWeakBag a = FastWeakBag JSVal
49newtype FastWeakBag a = FastWeakBag JSVal
src/Data/WeakBag.hs+2−2
@@ -31,8 +31,8 @@ import qualified Data.IntMap.Strict as IntMap
31import Data.IORef
31import Data.IORef
32import System.Mem.Weak
32import System.Mem.Weak
33
33
34−-- | A @WeakBag a@ holds a set of values of type @a@, but does not retain them -
34+-- | A 'WeakBag' holds a set of values of type @/a/@, but does not retain them -
35−-- that is, they can still be garbage-collected. As long as the @a@s remain
35+-- that is, they can still be garbage-collected. As long as the @/a/@ values remain
36-- alive, the 'WeakBag' will continue to refer to them.
36-- alive, the 'WeakBag' will continue to refer to them.
37data WeakBag a = WeakBag
37data WeakBag a = WeakBag
38 { _weakBag_nextId :: {-# UNPACK #-} !(IORef Int) --TODO: what if this wraps around?
38 { _weakBag_nextId :: {-# UNPACK #-} !(IORef Int) --TODO: what if this wraps around?
src/Reflex/Class.hs+12−13
@@ -34,10 +34,9 @@ module Reflex.Class
34 , coerceDynamic
34 , coerceDynamic
35 , MonadSample (..)
35 , MonadSample (..)
36 , MonadHold (..)
36 , MonadHold (..)
37− -- ** 'fan'-related types
37+ -- ** 'fan' related types
38 , EventSelector (..)
38 , EventSelector (..)
39 , EventSelectorInt (..)
39 , EventSelectorInt (..)
40− -- ** 'Incremental'-related types
41 -- * Convenience functions
40 -- * Convenience functions
42 , constDyn
41 , constDyn
43 , pushAlways
42 , pushAlways
@@ -201,7 +200,7 @@ import qualified Reflex.Patch.MapWithMove as PatchMapWithMove
201import Debug.Trace (trace)
200import Debug.Trace (trace)
202
201
203-- | The 'Reflex' class contains all the primitive functionality needed for
202-- | 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
205-- which "timeline" is in use. Timelines are fully-independent FRP contexts,
204-- which "timeline" is in use. Timelines are fully-independent FRP contexts,
206-- and the type of the timeline determines the FRP engine to be used. For most
205-- and the type of the timeline determines the FRP engine to be used. For most
207-- purposes, the 'Reflex.Spider' implementation is recommended.
206-- purposes, the 'Reflex.Spider' implementation is recommended.
@@ -267,7 +266,7 @@ class ( MonadHold t (PushM t)
267 -- | Create a new 'Dynamic'. The given 'PullM' must always return the most
266 -- | Create a new 'Dynamic'. The given 'PullM' must always return the most
268 -- recent firing of the given 'Event', if any.
267 -- recent firing of the given 'Event', if any.
269 unsafeBuildDynamic :: PullM t a -> Event t a -> Dynamic t a
268 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
271 -- in the same way that the accumulated application of patches would change
270 -- in the same way that the accumulated application of patches would change
272 -- that value.
271 -- that value.
273 unsafeBuildIncremental :: Patch p => PullM t (PatchTarget p) -> Event t p -> Incremental t p
272 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
310coerceDynamic = coerceWith $ dynamicCoercion Coercion
309coerceDynamic = coerceWith $ dynamicCoercion Coercion
311
310
312-- | Construct a 'Dynamic' from a 'Behavior' and an 'Event'. The 'Behavior'
311-- | 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
314-- 'Behavior''s value is always equal to the most recent firing of the 'Event';
313-- 'Behavior''s value is always equal to the most recent firing of the 'Event';
315-- if this is not the case, the resulting 'Dynamic' will behave
314-- if this is not the case, the resulting 'Dynamic' will behave
316-- nondeterministically.
315-- nondeterministically.
@@ -338,7 +337,7 @@ class MonadSample t m => MonadHold t m where
338 -- value and will be updated whenever the given 'Event' occurs. The update
337 -- value and will be updated whenever the given 'Event' occurs. The update
339 -- takes effect immediately after the 'Event' occurs; if the occurrence that
338 -- takes effect immediately after the 'Event' occurs; if the occurrence that
340 -- sets the 'Behavior' (or one that is simultaneous with it) is used to sample
339 -- 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
342 -- one.
341 -- one.
343 hold :: a -> Event t a -> m (Behavior t a)
342 hold :: a -> Event t a -> m (Behavior t a)
344 default hold :: (m ~ f m', MonadTrans f, MonadHold t m') => a -> Event t a -> m (Behavior t a)
343 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
641-- event returns 'True'.
640-- event returns 'True'.
642--
641--
643-- Starting at the current time, fire all the occurrences of the 'Event' for
642-- 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,
645-- do not fire, and permanently stop firing, even if 'True' values would have
644-- do not fire, and permanently stop firing, even if 'True' values would have
646-- been encountered later.
645-- been encountered later.
647takeWhileE
646takeWhileE
@@ -656,7 +655,7 @@ takeWhileE f = takeWhileJustE $ \v -> guard (f v) $> v
656-- event returns 'Just b'.
655-- event returns 'Just b'.
657--
656--
658-- Starting at the current time, fire all the occurrences of the 'Event' for
657-- 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,
660-- do not fire, and permanently stop firing, even if 'Just b' values would have
659-- do not fire, and permanently stop firing, even if 'Just b' values would have
661-- been encountered later.
660-- been encountered later.
662takeWhileJustE
661takeWhileJustE
@@ -829,7 +828,7 @@ fanMap = fan . fmap mapToDMap
829
828
830-- | Switches to the new event whenever it receives one. Only the old event is
829-- | Switches to the new event whenever it receives one. Only the old event is
831-- considered the moment a new one is switched in; the output event will fire at
830-- 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.
833--
832--
834-- Because the simultaneous firing case is irrelevant, this function imposes
833-- Because the simultaneous firing case is irrelevant, this function imposes
835-- laxer "timing requirements" on the overall circuit, avoiding many potential
834-- laxer "timing requirements" on the overall circuit, avoiding many potential
@@ -875,13 +874,13 @@ coincidencePatchMap e = fmapCheap PatchMap $ coincidence $ ffor e $ \(PatchMap m
875 Nothing -> fmapCheap (const Nothing) e
874 Nothing -> fmapCheap (const Nothing) e
876 Just ev -> leftmost [fmapCheap Just ev, fmapCheap (const Nothing) e]
875 Just ev -> leftmost [fmapCheap Just ev, fmapCheap (const Nothing) e]
877
876
878−-- | See 'coincicencePatchMap'
877+-- | See 'coincidencePatchMap'
879coincidencePatchIntMap :: Reflex t => Event t (PatchIntMap (Event t v)) -> Event t (PatchIntMap v)
878coincidencePatchIntMap :: Reflex t => Event t (PatchIntMap (Event t v)) -> Event t (PatchIntMap v)
880coincidencePatchIntMap e = fmapCheap PatchIntMap $ coincidence $ ffor e $ \(PatchIntMap m) -> mergeIntMap $ ffor m $ \case
879coincidencePatchIntMap e = fmapCheap PatchIntMap $ coincidence $ ffor e $ \(PatchIntMap m) -> mergeIntMap $ ffor m $ \case
881 Nothing -> fmapCheap (const Nothing) e
880 Nothing -> fmapCheap (const Nothing) e
882 Just ev -> leftmost [fmapCheap Just ev, fmapCheap (const Nothing) e]
881 Just ev -> leftmost [fmapCheap Just ev, fmapCheap (const Nothing) e]
883
882
884−-- | See 'coincicencePatchMap'
883+-- | See 'coincidencePatchMap'
885coincidencePatchMapWithMove :: (Reflex t, Ord k) => Event t (PatchMapWithMove k (Event t v)) -> Event t (PatchMapWithMove k v)
884coincidencePatchMapWithMove :: (Reflex t, Ord k) => Event t (PatchMapWithMove k (Event t v)) -> Event t (PatchMapWithMove k v)
886coincidencePatchMapWithMove e = fmapCheap unsafePatchMapWithMove $ coincidence $ ffor e $ \p -> mergeMap $ ffor (unPatchMapWithMove p) $ \ni -> case PatchMapWithMove._nodeInfo_from ni of
885coincidencePatchMapWithMove e = fmapCheap unsafePatchMapWithMove $ coincidence $ ffor e $ \p -> mergeMap $ ffor (unPatchMapWithMove p) $ \ni -> case PatchMapWithMove._nodeInfo_from ni of
887 PatchMapWithMove.From_Delete -> fforCheap e $ \_ ->
886 PatchMapWithMove.From_Delete -> fforCheap e $ \_ ->
@@ -942,7 +941,7 @@ zipDyn = zipDynWith (,)
942
941
943-- | Combine two 'Dynamic's with a combining function. The result will change
942-- | Combine two 'Dynamic's with a combining function. The result will change
944-- whenever either (or both) input 'Dynamic' changes.
943-- whenever either (or both) input 'Dynamic' changes.
945−-- More efficient than liftA2.
944+-- More efficient than 'liftA2'.
946zipDynWith :: Reflex t => (a -> b -> c) -> Dynamic t a -> Dynamic t b -> Dynamic t c
945zipDynWith :: Reflex t => (a -> b -> c) -> Dynamic t a -> Dynamic t b -> Dynamic t c
947zipDynWith f da db =
946zipDynWith f da db =
948 let eab = align (updated da) (updated db)
947 let eab = align (updated da) (updated db)
@@ -973,7 +972,7 @@ instance (Reflex t, Monoid a) => Monoid (Dynamic t a) where
973
972
974-- | This function converts a 'DMap' whose elements are 'Dynamic's into a
973-- | This function converts a 'DMap' whose elements are 'Dynamic's into a
975-- 'Dynamic' 'DMap'. Its implementation is more efficient than doing the same
974-- '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.
977distributeDMapOverDynPure :: forall t k. (Reflex t, GCompare k) => DMap k (Dynamic t) -> Dynamic t (DMap k Identity)
976distributeDMapOverDynPure :: forall t k. (Reflex t, GCompare k) => DMap k (Dynamic t) -> Dynamic t (DMap k Identity)
978distributeDMapOverDynPure dm = case DMap.toList dm of
977distributeDMapOverDynPure dm = case DMap.toList dm of
979 [] -> constDyn DMap.empty
978 [] -> constDyn DMap.empty
src/Reflex/Collection.hs+4−4
@@ -139,10 +139,10 @@ listWithKeyShallowDiff initialVals valsChanged mkChild = do
139--TODO: Something better than Dynamic t (Map k v) - we want something
139--TODO: Something better than Dynamic t (Map k v) - we want something
140--where the Events carry diffs, not the whole value
140--where the Events carry diffs, not the whole value
141-- | Create a dynamically-changing set of Event-valued widgets. This
141-- | Create a dynamically-changing set of Event-valued widgets. This
142−-- is like listWithKey, specialized for widgets returning (Event t
142+-- is like 'listWithKey', specialized for widgets returning @/Event t a/@.
143−-- a). listWithKey would return 'Dynamic t (Map k (Event t a))' in
143+-- 'listWithKey' would return @/Dynamic t (Map k (Event t a))/@ in
144−-- this scenario, but listViewWithKey flattens this to 'Event t (Map
144+-- this scenario, but 'listViewWithKey' flattens this to
145−-- k a)' via 'switch'.
145+-- @/Event t (Map k a)/@ via 'switch'.
146listViewWithKey
146listViewWithKey
147 :: (Ord k, Adjustable t m, PostBuild t m, MonadHold t m, MonadFix m)
147 :: (Ord k, Adjustable t m, PostBuild t m, MonadHold t m, MonadFix m)
148 => Dynamic t (Map k v)
148 => Dynamic t (Map k v)
src/Reflex/Dynamic.hs+17−17
@@ -58,6 +58,7 @@ module Reflex.Dynamic
58 , Demux
58 , Demux
59 , demux
59 , demux
60 , demuxed
60 , demuxed
61+ -- * Miscellaneous
61 -- Things that probably aren't very useful:
62 -- Things that probably aren't very useful:
62 , HList (..)
63 , HList (..)
63 , FHList (..)
64 , FHList (..)
@@ -67,7 +68,7 @@ module Reflex.Dynamic
67 , AllAreFunctors (..)
68 , AllAreFunctors (..)
68 , HListPtr (..)
69 , HListPtr (..)
69 , distributeFHListOverDynPure
70 , distributeFHListOverDynPure
70− -- Unsafe
71+ -- * Unsafe
71 , unsafeDynamic
72 , unsafeDynamic
72 -- * Deprecated functions
73 -- * Deprecated functions
73 , apDyn
74 , apDyn
@@ -130,7 +131,7 @@ holdUniqDyn = holdUniqDynBy (==)
130holdUniqDynBy :: (Reflex t, MonadHold t m, MonadFix m) => (a -> a -> Bool) -> Dynamic t a -> m (Dynamic t a)
131holdUniqDynBy :: (Reflex t, MonadHold t m, MonadFix m) => (a -> a -> Bool) -> Dynamic t a -> m (Dynamic t a)
131holdUniqDynBy eq = scanDynMaybe id (\new old -> if new `eq` old then Nothing else Just new)
132holdUniqDynBy eq = scanDynMaybe id (\new old -> if new `eq` old then Nothing else Just new)
132
133
133−-- | Dynamic Maybe that can only update from Nothing to Just or Just to Just (i.e., cannot revert to Nothing)
134+-- | @/Dynamic Maybe/@ that can only update from @/Nothing/@ to @/Just/@ or @/Just/@ to @/Just/@ (i.e., cannot revert to @/Nothing/@)
134improvingMaybe :: (Reflex t, MonadHold t m, MonadFix m) => Dynamic t (Maybe a) -> m (Dynamic t (Maybe a))
135improvingMaybe :: (Reflex t, MonadHold t m, MonadFix m) => Dynamic t (Maybe a) -> m (Dynamic t (Maybe a))
135improvingMaybe = scanDynMaybe id (\new _ -> if isJust new then Just new else Nothing)
136improvingMaybe = scanDynMaybe id (\new _ -> if isJust new then Just new else Nothing)
136
137
@@ -195,9 +196,9 @@ switchDyn :: forall t a. Reflex t => Dynamic t (Event t a) -> Event t a
195switchDyn d = switch (current d)
196switchDyn d = switch (current d)
196
197
197-- | Switches to the new 'Event' whenever it receives one. Switching occurs
198-- | Switches to the new 'Event' whenever it receives one. Switching occurs
198−-- *before* the inner 'Event' fires - so if the 'Dynamic' changes and both the
199+-- __before__ the inner 'Event' fires - so if the 'Dynamic' changes and both the
199-- old and new inner Events fire simultaneously, the output will fire with the
200-- old and new inner Events fire simultaneously, the output will fire with the
200−-- value of the *new* 'Event'.
201+-- value of the __new__ 'Event'.
201--
202--
202-- Prefer 'switchDyn' to this where possible. The timing requirements that
203-- Prefer 'switchDyn' to this where possible. The timing requirements that
203-- switching before imposes are likely to bring down your app unless you are
204-- switching before imposes are likely to bring down your app unless you are
@@ -238,7 +239,7 @@ joinDynThroughMap :: forall t k a. (Reflex t, Ord k) => Dynamic t (Map k (Dynami
238joinDynThroughMap = joinDyn . fmap distributeMapOverDynPure
239joinDynThroughMap = joinDyn . fmap distributeMapOverDynPure
239
240
240-- | Print the value of the 'Dynamic' when it is first read and on each
241-- | Print the value of the 'Dynamic' when it is first read and on each
241−-- subsequent change that is observed (as traceEvent), prefixed with the
242+-- subsequent change that is observed (as 'traceEvent'), prefixed with the
242-- provided string. This should /only/ be used for debugging.
243-- provided string. This should /only/ be used for debugging.
243--
244--
244-- Note: Just like Debug.Trace.trace, the value will only be shown if something
245-- Note: Just like Debug.Trace.trace, the value will only be shown if something
@@ -248,7 +249,7 @@ traceDyn s = traceDynWith $ \x -> s <> ": " <> show x
248
249
249-- | Print the result of applying the provided function to the value
250-- | Print the result of applying the provided function to the value
250-- of the 'Dynamic' when it is first read and on each subsequent change
251-- of the 'Dynamic' when it is first read and on each subsequent change
251−-- that is observed (as traceEvent). This should /only/ be used for
252+-- that is observed (as 'traceEvent'). This should /only/ be used for
252-- debugging.
253-- debugging.
253--
254--
254-- Note: Just like Debug.Trace.trace, the value will only be shown if something
255-- Note: Just like Debug.Trace.trace, the value will only be shown if something
@@ -264,27 +265,27 @@ traceDynWith f d =
264-- | Replace the value of the 'Event' with the current value of the 'Dynamic'
265-- | Replace the value of the 'Event' with the current value of the 'Dynamic'
265-- each time the 'Event' occurs.
266-- each time the 'Event' occurs.
266--
267--
267−-- Note: `tagPromptlyDyn d e` differs from `tag (current d) e` in the case that `e` is firing
268+-- Note: @/tagPromptlyDyn d e/@ differs from @/tag (current d) e/@ in the case that @/e/@ is firing
268−-- at the same time that `d` is changing. With `tagPromptlyDyn d e`, the *new* value of `d`
269+-- at the same time that @/d/@ is changing. With @/tagPromptlyDyn d e/@, the __new__ value of @/d/@
269−-- will replace the value of `e`, whereas with `tag (current d) e`, the *old* value
270+-- will replace the value of @/e/@, whereas with @/tag (current d) e/@, the __old__ value
270-- will be used, since the 'Behavior' won't be updated until the end of the frame.
271-- will be used, since the 'Behavior' won't be updated until the end of the frame.
271-- Additionally, this means that the output 'Event' may not be used to directly change
272-- Additionally, this means that the output 'Event' may not be used to directly change
272−-- the input 'Dynamic', because that would mean its value depends on itself. When creating
273+-- the input 'Dynamic', because that would mean its value depends on itself. __When creating__
273−-- cyclic data flows, generally `tag (current d) e` is preferred.
274+-- __cyclic data flows, generally @/tag (current d) e/@ is preferred.__
274tagPromptlyDyn :: Reflex t => Dynamic t a -> Event t b -> Event t a
275tagPromptlyDyn :: Reflex t => Dynamic t a -> Event t b -> Event t a
275tagPromptlyDyn = attachPromptlyDynWith const
276tagPromptlyDyn = attachPromptlyDynWith const
276
277
277-- | Attach the current value of the 'Dynamic' to the value of the
278-- | Attach the current value of the 'Dynamic' to the value of the
278-- 'Event' each time it occurs.
279-- 'Event' each time it occurs.
279--
280--
280−-- Note: `attachPromptlyDyn d` is not the same as `attach (current d)`. See 'tagPromptlyDyn' for details.
281+-- Note: @/attachPromptlyDyn d/@ is not the same as @/attach (current d)/@. See 'tagPromptlyDyn' for details.
281attachPromptlyDyn :: Reflex t => Dynamic t a -> Event t b -> Event t (a, b)
282attachPromptlyDyn :: Reflex t => Dynamic t a -> Event t b -> Event t (a, b)
282attachPromptlyDyn = attachPromptlyDynWith (,)
283attachPromptlyDyn = attachPromptlyDynWith (,)
283
284
284-- | Combine the current value of the 'Dynamic' with the value of the
285-- | Combine the current value of the 'Dynamic' with the value of the
285-- 'Event' each time it occurs.
286-- 'Event' each time it occurs.
286--
287--
287−-- Note: `attachPromptlyDynWith f d` is not the same as `attachWith f (current d)`. See 'tagPromptlyDyn' for details.
288+-- Note: @/attachPromptlyDynWith f d/@ is not the same as @/attachWith f (current d)/@. See 'tagPromptlyDyn' for details.
288attachPromptlyDynWith :: Reflex t => (a -> b -> c) -> Dynamic t a -> Event t b -> Event t c
289attachPromptlyDynWith :: Reflex t => (a -> b -> c) -> Dynamic t a -> Event t b -> Event t c
289attachPromptlyDynWith f = attachPromptlyDynWithMaybe $ \a b -> Just $ f a b
290attachPromptlyDynWith f = attachPromptlyDynWithMaybe $ \a b -> Just $ f a b
290
291
@@ -292,8 +293,7 @@ attachPromptlyDynWith f = attachPromptlyDynWithMaybe $ \a b -> Just $ f a b
292-- current value of the 'Dynamic' value and possibly filtering if the combining
293-- current value of the 'Dynamic' value and possibly filtering if the combining
293-- function returns 'Nothing'.
294-- function returns 'Nothing'.
294--
295--
295−-- Note: `attachPromptlyDynWithMaybe f d` is not the same as `attachWithMaybe f
296+-- Note: @/attachPromptlyDynWithMaybe f d/@ is not the same as @/attachWithMaybe f (current d)/@. See 'tagPromptlyDyn' for details.
296−-- (current d)`. See 'tagPromptlyDyn' for details.
297attachPromptlyDynWithMaybe :: Reflex t => (a -> b -> Maybe c) -> Dynamic t a -> Event t b -> Event t c
297attachPromptlyDynWithMaybe :: Reflex t => (a -> b -> Maybe c) -> Dynamic t a -> Event t b -> Event t c
298attachPromptlyDynWithMaybe f d e =
298attachPromptlyDynWithMaybe f d e =
299 let e' = attach (current d) e
299 let e' = attach (current d) e
@@ -302,8 +302,8 @@ attachPromptlyDynWithMaybe f d e =
302 These (_, b) a -> f a b -- Both events are firing, so use the newer value
302 These (_, b) a -> f a b -- Both events are firing, so use the newer value
303 That _ -> Nothing -- The tagging event isn't firing, so don't fire
303 That _ -> Nothing -- The tagging event isn't firing, so don't fire
304
304
305−-- | Factor a @Dynamic t (Maybe a)@ into a @Dynamic t (Maybe (Dynamic t a))@,
305+-- | Factor a @/Dynamic t (Maybe a)/@ into a @/Dynamic t (Maybe (Dynamic t a))/@,
306−-- such that the outer 'Dynamic' is updated only when the 'Maybe''s constructor
306+-- such that the outer 'Dynamic' is updated only when the "Maybe"'s constructor
307-- chages from 'Nothing' to 'Just' or vice-versa. Whenever the constructor
307-- chages from 'Nothing' to 'Just' or vice-versa. Whenever the constructor
308-- becomes 'Just', an inner 'Dynamic' will be provided, whose value will track
308-- becomes 'Just', an inner 'Dynamic' will be provided, whose value will track
309-- the 'a' inside the 'Just'; when the constructor becomes 'Nothing', the
309-- the 'a' inside the 'Just'; when the constructor becomes 'Nothing', the
src/Reflex/Pure.hs+4−4
@@ -43,12 +43,12 @@ import Data.Type.Coercion
43import Reflex.Class
43import Reflex.Class
44
44
45-- | A completely pure-functional 'Reflex' timeline, identifying moments in time
45-- | A completely pure-functional 'Reflex' timeline, identifying moments in time
46−-- with the type @t@.
46+-- with the type @/t/@.
47data Pure t
47data Pure t
48
48
49−-- | The Enum instance of t must be dense: for all x :: t, there must not exist
49+-- | The 'Enum' instance of @/t/@ must be dense: for all @/x :: t/@, there must not exist
50−-- any y :: t such that pred x < y < x. The HasTrie instance will be used
50+-- any @/y :: t/@ such that @/'pred' x < y < x/@. The 'HasTrie' instance will be used
51−-- exclusively to memoize functions of t, not for any of its other capabilities.
51+-- exclusively to memoize functions of @/t/@, not for any of its other capabilities.
52instance (Enum t, HasTrie t, Ord t) => Reflex (Pure t) where
52instance (Enum t, HasTrie t, Ord t) => Reflex (Pure t) where
53
53
54 newtype Behavior (Pure t) a = Behavior { unBehavior :: t -> a }
54 newtype Behavior (Pure t) a = Behavior { unBehavior :: t -> a }