on develop help sign in
Explain an Incremental in term of Dynamic
2ac4d2eRobert Klotzner
src/Reflex/Class.hs+5−3
@@ -211,13 +211,15 @@ class ( MonadHold t (PushM t)
211 -- occurring or not occurring; if it is occurring, it will contain a value of
211 -- occurring or not occurring; if it is occurring, it will contain a value of
212 -- the given type (its "occurrence type")
212 -- the given type (its "occurrence type")
213 data Event t :: * -> *
213 data Event t :: * -> *
214− -- | A 'Dynamic' is just an 'Incremental' whose patch type always completely
215− -- replaces the value (rather than doing some potentially-smaller change).
216− data Dynamic t :: * -> *
217 -- | A container for a value that can change over time and allows
214 -- | A container for a value that can change over time and allows
218 -- notifications on changes. Basically a combination of a 'Behavior' and an
215 -- notifications on changes. Basically a combination of a 'Behavior' and an
219 -- 'Event', with a rule that the 'Behavior' will change if and only if the
216 -- 'Event', with a rule that the 'Behavior' will change if and only if the
220 -- 'Event' fires.
217 -- 'Event' fires.
218+ data Dynamic t :: * -> *
219+ -- | An 'Incremental' is a more general form of an 'Dynamic'.
220+ -- Instead of always fully replacing the value, only parts of it can be patched.
221+ -- This is only needed for performance critical code via `mergeIncremental` to make small
222+ -- changes to large values.
221 data Incremental t :: * -> *
223 data Incremental t :: * -> *
222 -- | A monad for doing complex push-based calculations efficiently
224 -- | A monad for doing complex push-based calculations efficiently
223 type PushM t :: * -> *
225 type PushM t :: * -> *