diff --git a/src/Diff.hs b/src/Diff.hs index da83a4df5..a6e555ef5 100644 --- a/src/Diff.hs +++ b/src/Diff.hs @@ -44,7 +44,7 @@ mapAnnotations :: (Functor f, Functor g) => (annotation -> annotation') -> Free (TermF f (g annotation)) (Patch (Term f annotation)) -> Free (TermF f (g annotation')) (Patch (Term f annotation')) -mapAnnotations f = iter (\ (h :< functor) -> wrap (fmap f h :< functor)) . fmap (pure . fmap (fmap f)) +mapAnnotations f = iter (wrap . first (fmap f)) . fmap (pure . fmap (fmap f)) -- | Map a function over the annotations of a single diff node, if it is in Free. modifyAnnotations :: (Functor f, Functor g) => (annotation -> annotation) -> Free (TermF f (g annotation)) a -> Free (TermF f (g annotation)) a