@@ -111,8 +111,8 @@ pattern Coerce x <- (coerce -> x)
111111
112112{-# COMPLETE PatchMapWithMove #-}
113113pattern PatchMapWithMove :: Map k (NodeInfo k v ) -> PatchMapWithMove k v
114- -- | Extract the representation of the 'PatchMapWithMove' as a map of
115- -- 'NodeInfo'.
114+ -- | Extract the representation of the t 'PatchMapWithMove' as a map of
115+ -- t 'NodeInfo'.
116116unPatchMapWithMove :: PatchMapWithMove k v -> Map k (NodeInfo k v )
117117pattern PatchMapWithMove { unPatchMapWithMove } = PatchMapWithMove' (PatchMapWithPatchingMove (Coerce unPatchMapWithMove))
118118
@@ -147,27 +147,27 @@ instance L.FoldableWithIndex k (PatchMapWithMove k) where ifoldMap = Data.Fold
147147instance L. TraversableWithIndex k (PatchMapWithMove k ) where itraverse = Data.Traversable.WithIndex. itraverse
148148#endif
149149
150- -- | Create a 'PatchMapWithMove', validating it
150+ -- | Create a t 'PatchMapWithMove', validating it
151151patchMapWithMove :: Ord k => Map k (NodeInfo k v ) -> Maybe (PatchMapWithMove k v )
152152patchMapWithMove = fmap PatchMapWithMove' . PM. patchMapWithPatchingMove . coerce
153153
154- -- | Create a 'PatchMapWithMove' that inserts everything in the given 'Map'
154+ -- | Create a t 'PatchMapWithMove' that inserts everything in the given 'Map'
155155patchMapWithMoveInsertAll :: Map k v -> PatchMapWithMove k v
156156patchMapWithMoveInsertAll = PatchMapWithMove' . PM. patchMapWithPatchingMoveInsertAll
157157
158- -- | Make a @'PatchMapWithMove' k v@ which has the effect of inserting or updating a value @v@ to the given key @k@, like 'Map.insert'.
158+ -- | Make a @t 'PatchMapWithMove' k v@ which has the effect of inserting or updating a value @v@ to the given key @k@, like 'Map.insert'.
159159insertMapKey :: k -> v -> PatchMapWithMove k v
160160insertMapKey k v = PatchMapWithMove' $ PM. insertMapKey k v
161161
162- -- | Make a @'PatchMapWithMove' k v@ which has the effect of moving the value from the first key @k@ to the second key @k@, equivalent to:
162+ -- | Make a @t 'PatchMapWithMove' k v@ which has the effect of moving the value from the first key @k@ to the second key @k@, equivalent to:
163163--
164164-- @
165165-- 'Map.delete' src (maybe map ('Map.insert' dst) (Map.lookup src map))
166166-- @
167167moveMapKey :: Ord k => k -> k -> PatchMapWithMove k v
168168moveMapKey src dst = PatchMapWithMove' $ PM. moveMapKey src dst
169169
170- -- | Make a @'PatchMapWithMove' k v@ which has the effect of swapping two keys in the mapping, equivalent to:
170+ -- | Make a @t 'PatchMapWithMove' k v@ which has the effect of swapping two keys in the mapping, equivalent to:
171171--
172172-- @
173173-- let aMay = Map.lookup a map
@@ -179,13 +179,13 @@ moveMapKey src dst = PatchMapWithMove' $ PM.moveMapKey src dst
179179swapMapKey :: Ord k => k -> k -> PatchMapWithMove k v
180180swapMapKey src dst = PatchMapWithMove' $ PM. swapMapKey src dst
181181
182- -- | Make a @'PatchMapWithMove' k v@ which has the effect of deleting a key in the mapping, equivalent to 'Map.delete'.
182+ -- | Make a @t 'PatchMapWithMove' k v@ which has the effect of deleting a key in the mapping, equivalent to 'Map.delete'.
183183deleteMapKey :: k -> PatchMapWithMove k v
184184deleteMapKey = PatchMapWithMove' . PM. deleteMapKey
185185
186- -- | Wrap a @'Map' k (NodeInfo k v)@ representing patch changes into a @'PatchMapWithMove' k v@, without checking any invariants.
186+ -- | Wrap a @'Map' k (NodeInfo k v)@ representing patch changes into a @t 'PatchMapWithMove' k v@, without checking any invariants.
187187--
188- -- __Warning:__ when using this function, you must ensure that the invariants of 'PatchMapWithMove' are preserved; they will not be checked.
188+ -- __Warning:__ when using this function, you must ensure that the invariants of t 'PatchMapWithMove' are preserved; they will not be checked.
189189unsafePatchMapWithMove :: Map k (NodeInfo k v ) -> PatchMapWithMove k v
190190unsafePatchMapWithMove = coerce PM. unsafePatchMapWithPatchingMove
191191
@@ -198,25 +198,25 @@ instance Ord k => Patch (PatchMapWithMove k v) where
198198patchMapWithMoveNewElements :: PatchMapWithMove k v -> [v ]
199199patchMapWithMoveNewElements = PM. patchMapWithPatchingMoveNewElements . unPatchMapWithMove'
200200
201- -- | Return a @'Map' k v@ with all the inserts/updates from the given @'PatchMapWithMove' k v@.
201+ -- | Return a @'Map' k v@ with all the inserts/updates from the given @t 'PatchMapWithMove' k v@.
202202patchMapWithMoveNewElementsMap :: PatchMapWithMove k v -> Map k v
203203patchMapWithMoveNewElementsMap = PM. patchMapWithPatchingMoveNewElementsMap . unPatchMapWithMove'
204204
205- -- | Create a 'PatchMapWithMove' that, if applied to the given 'Map', will sort
205+ -- | Create a t 'PatchMapWithMove' that, if applied to the given 'Map', will sort
206206-- its values using the given ordering function. The set keys of the 'Map' is
207207-- not changed.
208208patchThatSortsMapWith :: Ord k => (v -> v -> Ordering ) -> Map k v -> PatchMapWithMove k v
209209patchThatSortsMapWith cmp = PatchMapWithMove' . PM. patchThatSortsMapWith cmp
210210
211- -- | Create a 'PatchMapWithMove' that, if applied to the first 'Map' provided,
211+ -- | Create a t 'PatchMapWithMove' that, if applied to the first 'Map' provided,
212212-- will produce a 'Map' with the same values as the second 'Map' but with the
213213-- values sorted with the given ordering function.
214214patchThatChangesAndSortsMapWith :: (Ord k , Ord v ) => (v -> v -> Ordering ) -> Map k v -> Map k v -> PatchMapWithMove k v
215215patchThatChangesAndSortsMapWith cmp oldByIndex newByIndexUnsorted = patchThatChangesMap oldByIndex newByIndex
216216 where newList = Map. toList newByIndexUnsorted
217217 newByIndex = Map. fromList $ zip (fst <$> newList) $ sortBy cmp $ snd <$> newList
218218
219- -- | Create a 'PatchMapWithMove' that, if applied to the first 'Map' provided,
219+ -- | Create a t 'PatchMapWithMove' that, if applied to the first 'Map' provided,
220220-- will produce the second 'Map'.
221221patchThatChangesMap :: (Ord k , Ord v ) => Map k v -> Map k v -> PatchMapWithMove k v
222222patchThatChangesMap oldByIndex newByIndex = PatchMapWithMove' $
@@ -262,6 +262,7 @@ instance Foldable (NodeInfo k) where
262262instance Traversable (NodeInfo k ) where
263263 traverse = bitraverseNodeInfo pure
264264
265+ -- | Like 'Data.Bitraversable.bitraverse'
265266bitraverseNodeInfo
266267 :: Applicative f
267268 => (k0 -> f k1 )
@@ -271,11 +272,11 @@ bitraverseNodeInfo fk fv = fmap NodeInfo'
271272 . PM. bitraverseNodeInfo fk (\ ~ Proxy -> pure Proxy ) fv
272273 . coerce
273274
274- -- | Change the 'From' value of a 'NodeInfo'
275+ -- | Change the 'From' value of a t 'NodeInfo'
275276nodeInfoMapFrom :: (From k v -> From k v ) -> NodeInfo k v -> NodeInfo k v
276277nodeInfoMapFrom f = coerce $ PM. nodeInfoMapFrom (unFrom' . f . From' )
277278
278- -- | Change the 'From' value of a 'NodeInfo', using a 'Functor' (or
279+ -- | Change the 'From' value of a t 'NodeInfo', using a 'Functor' (or
279280-- 'Applicative', 'Monad', etc.) action to get the new value
280281nodeInfoMapMFrom
281282 :: Functor f
@@ -285,7 +286,7 @@ nodeInfoMapMFrom f = fmap NodeInfo'
285286 . PM. nodeInfoMapMFrom (fmap unFrom' . f . From' )
286287 . coerce
287288
288- -- | Set the 'To' field of a 'NodeInfo'
289+ -- | Set the 'To' field of a t 'NodeInfo'
289290nodeInfoSetTo :: To k -> NodeInfo k v -> NodeInfo k v
290291nodeInfoSetTo = coerce . PM. nodeInfoSetTo
291292
@@ -310,6 +311,7 @@ pattern From_Delete = From' PM.From_Delete
310311pattern From_Move :: k -> From k v
311312pattern From_Move k = From' (PM. From_Move k Proxy )
312313
314+ -- | Like 'Data.Bitraversable.bitraverse'
313315bitraverseFrom
314316 :: Applicative f
315317 => (k0 -> f k1 )
0 commit comments