Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
haskell
forks
ixset-typed
Commits
abcdc58c
Commit
abcdc58c
authored
11 years ago
by
Andres Loeh
Browse files
Options
Download
Email Patches
Plain Diff
Add withRebuild.
parent
7a2cf941
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
src/Data/IxSet/Typed.hs
src/Data/IxSet/Typed.hs
+5
-0
tests/Example.hs
tests/Example.hs
+1
-1
No files found.
src/Data/IxSet/Typed.hs
View file @
abcdc58c
...
...
@@ -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.
--
...
...
This diff is collapsed.
Click to expand it.
tests/Example.hs
View file @
abcdc58c
...
...
@@ -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 =
r
ebuild (
entries
@= Author "john@doe.com") @< Updated t1
entries3
=
(
entries
`
withR
ebuild
`
(
@=
Author
"john@doe.com"
)
)
@<
Updated
t1
newtype
Word
=
Word
String
deriving
(
Show
,
Eq
,
Ord
)
newtype
FirstAuthor
=
FirstAuthor
Email
deriving
(
Show
,
Eq
,
Ord
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment