@@ -120,15 +120,9 @@ module Reflex.Class
120 , ffilter
120 , ffilter
121 , filterLeft
121 , filterLeft
122 , filterRight
122 , filterRight
125− , sequenceDMapWithAdjust
126− , sequenceDMapWithAdjustWithMove
127− , mapMapWithAdjustWithMove
128 -- * Miscellaneous convenience functions
123 -- * Miscellaneous convenience functions
130 -- * Deprecated functions
125 -- * Deprecated functions
132 , appendEvents
126 , appendEvents
134 , sequenceThese
128 , sequenceThese
@@ -163,7 +157,6 @@ import qualified Data.Dependent.Map as DMap
163import Data.FastMutableIntMap (PatchIntMap)
157import Data.FastMutableIntMap (PatchIntMap)
164import Data.Foldable
158import Data.Foldable
165import Data.Functor.Bind
159import Data.Functor.Bind
166−import Data.Functor.Constant
167import Data.Functor.Misc
160import Data.Functor.Misc
168import Data.Functor.Plus
161import Data.Functor.Plus
169import Data.IntMap.Strict (IntMap)
162import Data.IntMap.Strict (IntMap)
@@ -1062,47 +1055,6 @@ infixl 4 <@>
1062(<@) = tag
1055(<@) = tag
1063infixl 4 <@
1056infixl 4 <@
1069−-- | A 'Monad' that supports adjustment over time. After an action has been
1070−-- run, if the given events fire, it will adjust itself so that its net effect
1071−-- is as though it had originally been run with the new value. Note that there
1072−-- is some issue here with persistent side-effects: obviously, IO (and some
1073−-- other side-effects) cannot be undone, so it is up to the instance implementer
1074−-- to determine what the best meaning for this class is in such cases.
1075−class (Reflex t, Monad m) => Adjustable t m | m -> t where
1076− runWithReplace :: m a -> Event t (m b) -> m (a, Event t b)
1077− traverseIntMapWithKeyWithAdjust :: (IntMap.Key -> v -> m v') -> IntMap v -> Event t (PatchIntMap v) -> m (IntMap v', Event t (PatchIntMap v'))
1078− traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> m (DMap k v', Event t (PatchDMap k v'))
1079− traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> m (DMap k v', Event t (PatchDMapWithMove k v'))
1081−instance Adjustable t m => Adjustable t (ReaderT r m) where
1082− runWithReplace a0 a' = do
1084− lift $ runWithReplace (runReaderT a0 r) $ fmap (`runReaderT` r) a'
1085− traverseIntMapWithKeyWithAdjust f dm0 dm' = do
1087− lift $ traverseIntMapWithKeyWithAdjust (\k v -> runReaderT (f k v) r) dm0 dm'
1088− traverseDMapWithKeyWithAdjust f dm0 dm' = do
1090− lift $ traverseDMapWithKeyWithAdjust (\k v -> runReaderT (f k v) r) dm0 dm'
1091− traverseDMapWithKeyWithAdjustWithMove f dm0 dm' = do
1093− lift $ traverseDMapWithKeyWithAdjustWithMove (\k v -> runReaderT (f k v) r) dm0 dm'
1095−sequenceDMapWithAdjust :: (GCompare k, Adjustable t m) => DMap k m -> Event t (PatchDMap k m) -> m (DMap k Identity, Event t (PatchDMap k Identity))
1096−sequenceDMapWithAdjust = traverseDMapWithKeyWithAdjust $ \_ -> fmap Identity
1098−sequenceDMapWithAdjustWithMove :: (GCompare k, Adjustable t m) => DMap k m -> Event t (PatchDMapWithMove k m) -> m (DMap k Identity, Event t (PatchDMapWithMove k Identity))
1099−sequenceDMapWithAdjustWithMove = traverseDMapWithKeyWithAdjustWithMove $ \_ -> fmap Identity
1101−mapMapWithAdjustWithMove :: forall t m k v v'. (Adjustable t m, Ord k) => (k -> v -> m v') -> Map k v -> Event t (PatchMapWithMove k v) -> m (Map k v', Event t (PatchMapWithMove k v'))
1102−mapMapWithAdjustWithMove f m0 m' = do
1103− (out0 :: DMap (Const2 k v) (Constant v'), out') <- traverseDMapWithKeyWithAdjustWithMove (\(Const2 k) (Identity v) -> Constant <$> f k v) (mapToDMap m0) (const2PatchDMapWithMoveWith Identity <$> m')
1104− return (dmapToMapWith (\(Constant v') -> v') out0, patchDMapWithMoveToPatchMapWithMoveWith (\(Constant v') -> v') <$> out')
1106------------------
1058------------------
1107-- Cheap Functions
1059-- Cheap Functions
1108------------------
1060------------------
@@ -1151,9 +1103,6 @@ mergeWithFoldCheap' f es =
1151-- Deprecated functions
1103-- Deprecated functions
1152--------------------------------------------------------------------------------
1104--------------------------------------------------------------------------------
1154−{-# DEPRECATED MonadAdjust "Use Adjustable instead" #-}
1155−type MonadAdjust = Adjustable
1157-- | Create a new 'Event' that occurs if at least one of the supplied 'Event's
1106-- | Create a new 'Event' that occurs if at least one of the supplied 'Event's
1158-- occurs. If both occur at the same time they are combined using 'mappend'.
1107-- occurs. If both occur at the same time they are combined using 'mappend'.
1159{-# DEPRECATED appendEvents "If a 'Semigroup a' instance is available, use 'mappend'; otherwise, use 'alignWith (mergeThese mappend)' instead" #-}
1108{-# DEPRECATED appendEvents "If a 'Semigroup a' instance is available, use 'mappend'; otherwise, use 'alignWith (mergeThese mappend)' instead" #-}