on develop help sign in
Make Functor unnecessary for apDyn
commitbfe10ecc451b29a67fcd0631870ef37e3490be7e authorRyan Trinkle <ryan.trinkle@gmail.com> dateMon 1 Aug 2016, 16:41 (10 years ago) parent0950b23
1 file changed+3−2
src/Reflex/Dynamic.hs+3−2
src/Reflex/Dynamic.hs+3−2
@@ -474,11 +474,12 @@ combineDyn f a b = return $ zipDynWith f a b
474474-- > `apDyn` dynAge
475475-- > `apDyn` dynAddress
476476{-# DEPRECATED apDyn "Use 'ffor m (<*> a)' instead of 'apDyn m a'; consider eliminating monadic style, since Dynamics are now Applicative and can be used with applicative style directly" #-}
477−apDyn :: forall t m a b. (Reflex t, Functor m, Monad m)
477+{-# ANN apDyn "HLint: ignore Use fmap" #-}
478+apDyn :: forall t m a b. (Reflex t, Monad m)
478479 => m (Dynamic t (a -> b))
479480 -> Dynamic t a
480481 -> m (Dynamic t b)
481−apDyn m a = ffor m (<*> a)
482+apDyn m a = liftM (<*> a) m
482483
483484--TODO: The pattern of using hold (sample b0) can be reused in various places as a safe way of building certain kinds of Dynamics; see if we can factor this out
484485-- | This function no longer needs to be monadic, so it has been replaced by