on develop help sign in
Make Functor unnecessary for apDyn
bfe10ecRyan Trinkle
src/Reflex/Dynamic.hs+3−2
@@ -474,11 +474,12 @@ combineDyn f a b = return $ zipDynWith f a b
474-- > `apDyn` dynAge
474-- > `apDyn` dynAge
475-- > `apDyn` dynAddress
475-- > `apDyn` dynAddress
476{-# 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" #-}
476{-# 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+{-# ANN apDyn "HLint: ignore Use fmap" #-}
477−apDyn :: forall t m a b. (Reflex t, Functor m, Monad m)
478+apDyn :: forall t m a b. (Reflex t, Monad m)
478 => m (Dynamic t (a -> b))
479 => m (Dynamic t (a -> b))
479 -> Dynamic t a
480 -> Dynamic t a
480 -> m (Dynamic t b)
481 -> m (Dynamic t b)
481−apDyn m a = ffor m (<*> a)
482+apDyn m a = liftM (<*> a) m
482
483
483--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
484--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
484-- | This function no longer needs to be monadic, so it has been replaced by
485-- | This function no longer needs to be monadic, so it has been replaced by