1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 18:36:27 +03:00

Simplify mapAnnotations.

This commit is contained in:
Rob Rix 2017-05-09 13:33:17 -04:00
parent 118e94a2a7
commit c166973676

View File

@ -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 (wrap . first (fmap f)) . fmap (pure . fmap (fmap f))
mapAnnotations f = hoistFree (first (fmap f)) . fmap (fmap (fmap f))
-- | Fold a diff with a combining rule for replacement patches and an algebra on the annotated syntax functor.