mirror of
https://github.com/github/semantic.git
synced 2025-01-02 20:41:38 +03:00
📝 modifyAnnotations.
This commit is contained in:
parent
051916082a
commit
d9e44ede6c
@ -53,6 +53,7 @@ mapAnnotations :: (Functor f, Functor g)
|
||||
mapAnnotations f = iter (\ (h :< functor) -> wrap (fmap f h :< functor)) . 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
|
||||
modifyAnnotations f r = case runFree r of
|
||||
Free (ga :< functor) -> wrap (fmap f ga :< functor)
|
||||
|
Loading…
Reference in New Issue
Block a user