1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

📝 the generalization.

This commit is contained in:
Rob Rix 2017-02-07 15:03:59 -05:00
parent 7263b683e5
commit 9a39762d91

View File

@ -44,6 +44,8 @@ afterTerm = mergeMaybe after Both.snd
-- | Map a function over the annotations in a diff, whether in diff or term nodes. -- | Map a function over the annotations in a diff, whether in diff or term nodes.
--
-- Typed using Free so as to accommodate Free structures derived from diffs that dont fit into the Diff type synonym (e.g. because the leaves arent in Patch).
mapAnnotations :: (Functor f, Functor g) mapAnnotations :: (Functor f, Functor g)
=> (annotation -> annotation') => (annotation -> annotation')
-> Free (TermF f (g annotation)) (Patch (Term f annotation)) -> Free (TermF f (g annotation)) (Patch (Term f annotation))