File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ instance Patch (PatchIntMap a) where
45
45
instance FunctorWithIndex Int PatchIntMap
46
46
instance FoldableWithIndex Int PatchIntMap
47
47
instance TraversableWithIndex Int PatchIntMap where
48
- itraversed = _Wrapped . itraversed . traversed
48
+ itraverse = itraversed . Indexed
49
+ itraversed = _Wrapped .> itraversed <. traversed
49
50
50
51
-- | Map a function @Int -> a -> b@ over all @a@s in the given @'PatchIntMap' a@
51
52
-- (that is, all inserts/updates), producing a @PatchIntMap b@.
Original file line number Diff line number Diff line change @@ -54,7 +54,8 @@ instance Ord k => Patch (PatchMap k v) where
54
54
instance FunctorWithIndex k (PatchMap k )
55
55
instance FoldableWithIndex k (PatchMap k )
56
56
instance TraversableWithIndex k (PatchMap k ) where
57
- itraverse f (PatchMap x) = PatchMap <$> itraverse (traverse . f) x
57
+ itraverse = itraversed . Indexed
58
+ itraversed = _Wrapped .> itraversed <. traversed
58
59
59
60
-- | The empty 'PatchMap' contains no insertions or deletions
60
61
instance Ord k => Monoid (PatchMap k v ) where
Original file line number Diff line number Diff line change @@ -68,7 +68,8 @@ makeWrapped ''PatchMapWithMove
68
68
instance FunctorWithIndex k (PatchMapWithMove k )
69
69
instance FoldableWithIndex k (PatchMapWithMove k )
70
70
instance TraversableWithIndex k (PatchMapWithMove k ) where
71
- itraverse f (PatchMapWithMove x) = PatchMapWithMove <$> itraverse (traverse . f) x
71
+ itraverse = itraversed . Indexed
72
+ itraversed = _Wrapped .> itraversed <. traversed
72
73
73
74
-- | Create a 'PatchMapWithMove', validating it
74
75
patchMapWithMove :: Ord k => Map k (NodeInfo k v ) -> Maybe (PatchMapWithMove k v )
You can’t perform that action at this time.
0 commit comments