You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rename Data.{Fast,}WeakBag.traverse to Data.{Fast,}WeakBag.traverse_
Renamed Data.FastWeakBag.traverse and Data.WeakBag.traverse to
Data.FastWeakBag.traverse_ and Data.WeakBag.traverse_ respectively.
This is a more accurate naming for the function as it has no resulting
value in the same way Data.Foldable.traverse_, and unlike
Data.Traverseable.traverse which has a resulting value. In addition,
we do not have to ignore any hlint warnings any more.
--TODO: Fix the race condition where if a cursor is deleted (presumably using 'remove', below) while we're holding it, it can't find its way back to the correct bag
135
136
foreignimport javascript unsafe"(function(){ for(var i = $1.pos - 1; i >= 0; i--) { if($1.bag.tickets[i] !== null) { return $1.bag.tickets[i]; } }; return null; })()" js_getNext ::FastWeakBagTicketa->IOJSVal--TODO: Clean up as we go along so this isn't O(n) every time -- Result can be null or a FastWeakBagTicket a
136
137
#else
137
-
traverse (FastWeakBag _ children) f = {-# SCC "traverse" #-} do
138
+
traverse_ (FastWeakBag _ children) f = {-# SCC "traverse_" #-} do
@@ -542,14 +542,14 @@ propagate :: a -> WeakBag (Subscriber x a) -> EventM x ()
542
542
propagate a subscribers = withIncreasedDepth $do
543
543
-- Note: in the following traversal, we do not visit nodes that are added to the list during our traversal; they are new events, which will necessarily have full information already, so there is no need to traverse them
544
544
--TODO: Should we check if nodes already have their values before propagating? Maybe we're re-doing work
545
-
WeakBag.traverse subscribers $\s -> subscriberPropagate s a
545
+
WeakBag.traverse_ subscribers $\s -> subscriberPropagate s a
propagateFast a subscribers = withIncreasedDepth $do
550
550
-- Note: in the following traversal, we do not visit nodes that are added to the list during our traversal; they are new events, which will necessarily have full information already, so there is no need to traverse them
551
551
--TODO: Should we check if nodes already have their values before propagating? Maybe we're re-doing work
552
-
FastWeakBag.traverse subscribers $\s -> subscriberPropagate s a
552
+
FastWeakBag.traverse_ subscribers $\s -> subscriberPropagate s a
@@ -1527,15 +1527,15 @@ fanInt p = unsafePerformIO $ do
1527
1527
liftIO $ writeIORef (_fanInt_occRef self) m
1528
1528
scheduleIntClear $ _fanInt_occRef self
1529
1529
FastMutableIntMap.forIntersectionWithImmutable_ (_fanInt_subscribers self) m $\b v ->do--TODO: Do we need to know that no subscribers are being added as we traverse?
mapM_ _someMergeUpdate_invalidateHeight mergeUpdates --TODO: In addition to when the patch is completely empty, we should also not run this if it has some Nothing values, but none of them have actually had any effect; potentially, we could even check for Just values with no effect (e.g. by comparing their IORefs and ignoring them if they are unchanged); actually, we could just check if the new height is different
0 commit comments