mirror of
https://github.com/github/semantic.git
synced 2024-11-28 01:47:01 +03:00
Remove DiffF type synonym
This commit is contained in:
parent
2f761fc38b
commit
b1f9cc4a4a
@ -21,7 +21,6 @@ annotate :: annotation -> Syntax a f -> CofreeF (Syntax a) annotation f
|
||||
annotate = (:<)
|
||||
|
||||
-- | An annotated series of patches of terms.
|
||||
type DiffF a annotation = FreeF (CofreeF (Syntax a) (Both annotation)) (Patch (Term a annotation))
|
||||
type Diff a annotation = Free (CofreeF (Syntax a) (Both annotation)) (Patch (Term a annotation))
|
||||
|
||||
type instance Base (Free f a) = FreeF f a
|
||||
|
@ -78,7 +78,7 @@ instance Show a => Show (DiffSummary a) where
|
||||
|
||||
diffSummary :: HasCategory leaf => Diff leaf Info -> [DiffSummary DiffInfo]
|
||||
diffSummary = cata diffSummary' where
|
||||
diffSummary' :: HasCategory leaf => DiffF leaf Info [DiffSummary DiffInfo] -> [DiffSummary DiffInfo]
|
||||
diffSummary' :: HasCategory leaf => Base (Diff leaf Info) [DiffSummary DiffInfo] -> [DiffSummary DiffInfo]
|
||||
diffSummary' (Free (_ :< Leaf _)) = [] -- Skip leaves since they don't have any changes
|
||||
diffSummary' (Free (infos :< Indexed children)) = prependSummary (DiffInfo (toCategoryName . toCategory $ snd infos) Nothing) <$> join children
|
||||
diffSummary' (Free (infos :< Fixed children)) = prependSummary (DiffInfo (toCategoryName . toCategory $ snd infos) Nothing) <$> join children
|
||||
|
Loading…
Reference in New Issue
Block a user