Commit abcdc58c authored by Andres Loeh's avatar Andres Loeh
Browse files

Add withRebuild.

parent 7a2cf941
......@@ -172,6 +172,7 @@ module Data.IxSet.Typed
groupAscBy,
groupDescBy,
rebuild,
withRebuild,
-- * Index creation helpers
flatten,
......@@ -563,6 +564,10 @@ insertList xs (IxSet a indexes) = IxSet (List.foldl' (\ b x -> Set.insert x b) a
index' :: Map ix (Set a)
index' = Ix.insertList dss index
withRebuild :: IndexableWithIndex ixs ix a
=> IxSet ixs a -> (IxSet ixs a -> IxSet '[ix] a) -> IxSet ixs a
withRebuild ixset op = rebuild (op ixset)
-- | Internal helper function that takes a partial index from one index
-- set and rebuilds the rest of the structure of the index set.
--
......
......@@ -39,7 +39,7 @@ t1 = UTCTime (fromGregorian 2014 03 06) 0
t2 = UTCTime (fromGregorian 2012 12 12) 0
t3 = UTCTime (fromGregorian 1909 09 09) 0
-- entries3 = rebuild (entries @= Author "john@doe.com") @< Updated t1
entries3 = (entries `withRebuild` (@= Author "john@doe.com")) @< Updated t1
newtype Word = Word String deriving (Show, Eq, Ord)
newtype FirstAuthor = FirstAuthor Email deriving (Show, Eq, Ord)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment