1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 12:51:52 +03:00

Generalize diffSummary to extensible record annotations.

This commit is contained in:
Rob Rix 2016-07-14 15:51:09 -04:00
parent 0bbe856d3d
commit 3166b53f52

View File

@ -67,7 +67,7 @@ instance Show (DiffSummary DiffInfo) where
then ""
else " in the " ++ intercalate "/" (categoryName <$> parentAnnotations) ++ " context"
diffSummary :: HasCategory leaf => Diff leaf Info -> [DiffSummary DiffInfo]
diffSummary :: (HasCategory leaf, HasField fields Category) => Diff leaf (Record fields) -> [DiffSummary DiffInfo]
diffSummary = cata diffSummary' where
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