mirror of
https://github.com/ilyakooo0/reflex.git
synced 2024-10-04 05:37:09 +03:00
parent
fd38931431
commit
72ec2a9166
@ -1,5 +1,9 @@
|
||||
# Revision history for reflex
|
||||
|
||||
## Unreleased
|
||||
|
||||
* Add `Reflex.Query.Base.mapQueryT`. See that module for documentation
|
||||
|
||||
## 0.6.3
|
||||
|
||||
* `Data.WeakBag.traverse` and `Data.FastWeakBag.traverse` have been deprecated.
|
||||
|
@ -16,6 +16,7 @@ module Reflex.Query.Base
|
||||
, mapQueryResult
|
||||
, dynWithQueryT
|
||||
, withQueryT
|
||||
, mapQueryT
|
||||
) where
|
||||
|
||||
import Control.Applicative (liftA2)
|
||||
@ -287,6 +288,10 @@ withQueryT f a = do
|
||||
(fmapCheap (AdditivePatch . mapQuery f . unAdditivePatch) $ updatedIncremental q)
|
||||
return result
|
||||
|
||||
-- | Maps a function over a 'QueryT' that can change the underlying monad
|
||||
mapQueryT :: (forall b. m b -> n b) -> QueryT t q m a -> QueryT t q n a
|
||||
mapQueryT f (QueryT a) = QueryT $ mapStateT (mapEventWriterT (mapReaderT f)) a
|
||||
|
||||
-- | dynWithQueryT's (Dynamic t QueryMorphism) argument needs to be a group homomorphism at all times in order to behave correctly
|
||||
dynWithQueryT :: (MonadFix m, PostBuild t m, Group q, Additive q, Group q', Additive q', Query q')
|
||||
=> Dynamic t (QueryMorphism q q')
|
||||
|
Loading…
Reference in New Issue
Block a user