on develop help sign in
Get rid of partitionDMapBySetLT
commit1ab18f302a8d8e5880408869fd675c90555a3448 authorRyan Trinkle <ryan.trinkle@gmail.com> dateMon 3 Oct 2016, 10:13 (10 years ago) parentd4be4a9
1 file changed−13
src/Reflex/Dom/Widget/Basic.hs−13
src/Reflex/Dom/Widget/Basic.hs−13
@@ -133,19 +133,6 @@ partitionMapBySetLT s m0 = Map.fromDistinctAscList $ go (Set.toAscList s) m0
133133 then go t geq
134134 else (Left h, lt) : go t geq
135135
136−partitionDMapBySetLT :: forall k v. GCompare k => Set (Some k) -> DMap k v -> Map (Either (Some k) ()) (DMap k v)
137−partitionDMapBySetLT s m0 = Map.fromDistinctAscList $ go (Set.toAscList s) m0
138− where go :: [Some k] -> DMap k v -> [(Either (Some k) (), DMap k v)]
139− go [] m = if DMap.null m
140− then []
141− else [(Right (), m)]
142− go (sh@(Some.This h) : t) m =
143− let (lt, eq, gt) = DMap.splitLookup h m
144− geq = maybe id (DMap.insert h) eq gt
145− in if DMap.null lt
146− then go t geq
147− else (Left sh, lt) : go t geq
148−
149136newtype ChildResult t k a = ChildResult { unChildResult :: (a, Event t (Map k (Maybe (ChildResult t k a)))) }
150137
151138listHoldWithKey :: forall t m k v a. (Ord k, DomBuilder t m, MonadHold t m) => Map k v -> Event t (Map k (Maybe v)) -> (k -> v -> m a) -> m (Dynamic t (Map k a))