1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 23:11:50 +03:00

Generalize diffSummary over records.

This commit is contained in:
Rob Rix 2016-07-14 14:25:37 -04:00
parent 13d2dfc24f
commit f51b1724fe

View File

@ -116,7 +116,7 @@ instance Show (DiffSummary DiffInfo) where
then ""
else " in the " <> intercalate "/" (toCategoryName <$> parentAnnotations) <> " context"
diffSummary :: HasCategory leaf => Diff leaf Info -> [DiffSummary DiffInfo]
diffSummary :: (HasCategory leaf, HasField fields Category) => Diff leaf (Record fields) -> [DiffSummary DiffInfo]
diffSummary = cata $ \case
-- Skip comments and leaves since they don't have any changes
(Free (_ :< Leaf _)) -> []