Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype TreeDiff m = TreeDiff {
- unTreeDiff :: Cofree (Compose (Map NameSegment) m) DefinitionDiffs
- hoistTreeDiff :: Functor m => (forall x. m x -> n x) -> TreeDiff m -> TreeDiff n
- data NameChanges = NameChanges {
- termNameAdds :: [(Name, Referent)]
- termNameRemovals :: [(Name, Referent)]
- typeNameAdds :: [(Name, Reference)]
- typeNameRemovals :: [(Name, Reference)]
- data DefinitionDiffs = DefinitionDiffs {
- termDiffs :: Map NameSegment (Diff Referent)
- typeDiffs :: Map NameSegment (Diff Reference)
- data Diff a = Diff {}
- data NameBasedDiff = NameBasedDiff {}
- diffBranches :: Branch Transaction -> Branch Transaction -> Transaction (TreeDiff Transaction)
- allNameChanges :: Monad m => Maybe Name -> TreeDiff m -> m NameChanges
- nameBasedDiff :: Monad m => TreeDiff m -> m NameBasedDiff
- streamNameChanges :: (Monad m, Monoid r) => Maybe Name -> TreeDiff m -> (Maybe Name -> NameChanges -> m r) -> m r
Documentation
A tree of local diffs. Each node of the tree contains the definition diffs at that path.
TreeDiff | |
|
Instances
Applicative m => Monoid (TreeDiff m) Source # | |
Applicative m => Semigroup (TreeDiff m) Source # | |
Show1 m => Show (TreeDiff m) Source # | |
Eq1 m => Eq (TreeDiff m) Source # | |
Ord1 m => Ord (TreeDiff m) Source # | |
data NameChanges Source #
A summary of a TreeDiff
, containing all names added and removed.
Note that there isn't a clear notion of a name "changing" since conflicts might muddy the notion
by having multiple copies of both the from and to names, so we just talk about adds and
removals instead.
NameChanges | |
|
Instances
Monoid NameChanges Source # | |
Defined in U.Codebase.Branch.Diff mempty :: NameChanges # mappend :: NameChanges -> NameChanges -> NameChanges # mconcat :: [NameChanges] -> NameChanges # | |
Semigroup NameChanges Source # | |
Defined in U.Codebase.Branch.Diff (<>) :: NameChanges -> NameChanges -> NameChanges # sconcat :: NonEmpty NameChanges -> NameChanges # stimes :: Integral b => b -> NameChanges -> NameChanges # | |
Show NameChanges Source # | |
Defined in U.Codebase.Branch.Diff showsPrec :: Int -> NameChanges -> ShowS # show :: NameChanges -> String # showList :: [NameChanges] -> ShowS # | |
Eq NameChanges Source # | |
Defined in U.Codebase.Branch.Diff (==) :: NameChanges -> NameChanges -> Bool # (/=) :: NameChanges -> NameChanges -> Bool # |
data DefinitionDiffs Source #
Represents the changes to definitions at a given path, not including child paths.
Note: doesn't yet include any info on patch diffs. Feel free to add it.
DefinitionDiffs | |
|
Instances
data NameBasedDiff Source #
A name-based diff for namespaces N1
and N2
is (for both terms and types) a relation between references, where
`a R b` if:
a
has namen
inN1
, andb
has the same namen
inN2
a
!=b
Instances
diffBranches :: Branch Transaction -> Branch Transaction -> Transaction (TreeDiff Transaction) Source #
Diff two Branches, returning a tree containing all of the changes
allNameChanges :: Monad m => Maybe Name -> TreeDiff m -> m NameChanges Source #
Get a summary of all of the name adds and removals from a tree diff.
The provided name will be prepended to all names in the output diff, and can be useful if diffing branches at a
specific sub-tree, but you can pass Nothing
if you're diffing from the root.
nameBasedDiff :: Monad m => TreeDiff m -> m NameBasedDiff Source #
Get a NameBasedDiff
from a TreeDiff
.
streamNameChanges :: (Monad m, Monoid r) => Maybe Name -> TreeDiff m -> (Maybe Name -> NameChanges -> m r) -> m r Source #
Stream a summary of all of the name adds and removals from a tree diff.
Callback is passed the diff from one namespace level at a time, with the name representing
that location.
Accumulator is folded strictly, use ()
if you don't need one.