File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 7
7
-- insert/update or delete of associations.
8
8
module Data.Patch.IntMap where
9
9
10
+ import Control.Lens
10
11
import Data.IntMap.Strict (IntMap )
11
12
import qualified Data.IntMap.Strict as IntMap
12
13
import Data.Maybe
@@ -34,6 +35,11 @@ instance Semigroup (PatchIntMap v) where
34
35
-- PatchMap is idempotent, so stimes n is id for every n
35
36
stimes = stimesIdempotentMonoid
36
37
38
+ instance FunctorWithIndex Int PatchIntMap
39
+ instance FoldableWithIndex Int PatchIntMap
40
+ instance TraversableWithIndex Int PatchIntMap where
41
+ itraversed = _Wrapped . itraversed . traversed
42
+
37
43
-- | Map a function @Int -> a -> b@ over all @a@s in the given @'PatchIntMap' a@
38
44
-- (that is, all inserts/updates), producing a @PatchIntMap b@.
39
45
mapIntMapPatchWithKey :: (Int -> a -> b ) -> PatchIntMap a -> PatchIntMap b
You can’t perform that action at this time.
0 commit comments