mirror of
https://github.com/github/semantic.git
synced 2024-12-19 21:01:35 +03:00
Generalize diffSummary' to extensible record annotations.
This commit is contained in:
parent
ea6ff00a7a
commit
0bbe856d3d
@ -69,7 +69,7 @@ instance Show (DiffSummary DiffInfo) where
|
||||
|
||||
diffSummary :: HasCategory leaf => Diff leaf Info -> [DiffSummary DiffInfo]
|
||||
diffSummary = cata diffSummary' where
|
||||
diffSummary' :: HasCategory leaf => Base (Diff leaf Info) [DiffSummary DiffInfo] -> [DiffSummary DiffInfo]
|
||||
diffSummary' :: (HasCategory leaf, HasField fields Category) => Base (Diff leaf (Record fields)) [DiffSummary DiffInfo] -> [DiffSummary DiffInfo]
|
||||
diffSummary' (Free (_ :< Leaf _)) = [] -- Skip leaves since they don't have any changes
|
||||
diffSummary' (Free (infos :< Indexed children)) = prependSummary (DiffInfo (toCategoryName . category $ snd infos) Nothing) <$> join children
|
||||
diffSummary' (Free (infos :< Fixed children)) = prependSummary (DiffInfo (toCategoryName . category $ snd infos) Nothing) <$> join children
|
||||
|
Loading…
Reference in New Issue
Block a user