1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

📝 mapAnnotations.

This commit is contained in:
Rob Rix 2017-02-07 14:58:11 -05:00
parent 4a3dd9afd8
commit bb46960dd8

View File

@ -43,5 +43,6 @@ afterTerm :: Mergeable f => Diff f annotation -> Maybe (Term f annotation)
afterTerm = mergeMaybe after Both.snd
-- | Map a function over the annotations in a diff, whether in diff or term nodes.
mapAnnotations :: Functor f => (annotation -> annotation') -> Diff f annotation -> Diff f annotation'
mapAnnotations f = iter (\ (h :< functor) -> wrap (fmap f h :< functor)) . fmap (pure . fmap (fmap f))