on develop help sign in
Merge pull request #39 from snoyberg/develop

Functor instance for Dynamic

commit6924dad048bc020ba4dc3da5d56af412c0ca5618 authorRyan Trinkle <ryan.trinkle@gmail.com> dateThu 7 Jan 2016, 16:44 (11 years ago) parent7cbc8dc19777e9
1 file changed+5
src/Reflex/Dynamic.hs+5
src/Reflex/Dynamic.hs+5
@@ -93,6 +93,11 @@ instance HBuild' (a ': l) r
9393-- | A container for a value that can change over time and allows notifications on changes.
9494-- Basically a combination of a 'Behavior' and an 'Event', with a rule that the Behavior will
9595-- change if and only if the Event fires.
96+--
97+-- Although @Dynamic@ logically has a 'Functor' instance, currently it can\'t
98+-- be implemented without potentially requiring the mapped function to be
99+-- evaluated twice. Instead, you can use 'mapDyn', which runs in a 'MonadHold'
100+-- instance, to achieve the same result.
96101data Dynamic t a
97102 = Dynamic (Behavior t a) (Event t a)
98103