unison-parser-typechecker-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

U.Codebase.Branch.Diff

Synopsis

Documentation

newtype TreeDiff m Source #

A tree of local diffs. Each node of the tree contains the definition diffs at that path.

Instances

Instances details
Applicative m => Monoid (TreeDiff m) Source # 
Instance details

Defined in U.Codebase.Branch.Diff

Methods

mempty :: TreeDiff m #

mappend :: TreeDiff m -> TreeDiff m -> TreeDiff m #

mconcat :: [TreeDiff m] -> TreeDiff m #

Applicative m => Semigroup (TreeDiff m) Source # 
Instance details

Defined in U.Codebase.Branch.Diff

Methods

(<>) :: TreeDiff m -> TreeDiff m -> TreeDiff m #

sconcat :: NonEmpty (TreeDiff m) -> TreeDiff m #

stimes :: Integral b => b -> TreeDiff m -> TreeDiff m #

Show1 m => Show (TreeDiff m) Source # 
Instance details

Defined in U.Codebase.Branch.Diff

Methods

showsPrec :: Int -> TreeDiff m -> ShowS #

show :: TreeDiff m -> String #

showList :: [TreeDiff m] -> ShowS #

Eq1 m => Eq (TreeDiff m) Source # 
Instance details

Defined in U.Codebase.Branch.Diff

Methods

(==) :: TreeDiff m -> TreeDiff m -> Bool #

(/=) :: TreeDiff m -> TreeDiff m -> Bool #

Ord1 m => Ord (TreeDiff m) Source # 
Instance details

Defined in U.Codebase.Branch.Diff

Methods

compare :: TreeDiff m -> TreeDiff m -> Ordering #

(<) :: TreeDiff m -> TreeDiff m -> Bool #

(<=) :: TreeDiff m -> TreeDiff m -> Bool #

(>) :: TreeDiff m -> TreeDiff m -> Bool #

(>=) :: TreeDiff m -> TreeDiff m -> Bool #

max :: TreeDiff m -> TreeDiff m -> TreeDiff m #

min :: TreeDiff m -> TreeDiff m -> TreeDiff m #

hoistTreeDiff :: Functor m => (forall x. m x -> n x) -> TreeDiff m -> TreeDiff n 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.

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.

data Diff a Source #

Constructors

Diff 

Fields

Instances

Instances details
Show a => Show (Diff a) Source # 
Instance details

Defined in U.Codebase.Branch.Diff

Methods

showsPrec :: Int -> Diff a -> ShowS #

show :: Diff a -> String #

showList :: [Diff a] -> ShowS #

Eq a => Eq (Diff a) Source # 
Instance details

Defined in U.Codebase.Branch.Diff

Methods

(==) :: Diff a -> Diff a -> Bool #

(/=) :: Diff a -> Diff a -> Bool #

Ord a => Ord (Diff a) Source # 
Instance details

Defined in U.Codebase.Branch.Diff

Methods

compare :: Diff a -> Diff a -> Ordering #

(<) :: Diff a -> Diff a -> Bool #

(<=) :: Diff a -> Diff a -> Bool #

(>) :: Diff a -> Diff a -> Bool #

(>=) :: Diff a -> Diff a -> Bool #

max :: Diff a -> Diff a -> Diff a #

min :: Diff a -> Diff a -> Diff a #

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:

  1. a has name n in N1, and b has the same name n in N2
  2. a != b

Instances

Instances details
Monoid NameBasedDiff Source # 
Instance details

Defined in U.Codebase.Branch.Diff

Semigroup NameBasedDiff Source # 
Instance details

Defined in U.Codebase.Branch.Diff

Generic NameBasedDiff Source # 
Instance details

Defined in U.Codebase.Branch.Diff

Associated Types

type Rep NameBasedDiff :: Type -> Type #

Show NameBasedDiff Source # 
Instance details

Defined in U.Codebase.Branch.Diff

type Rep NameBasedDiff Source # 
Instance details

Defined in U.Codebase.Branch.Diff

type Rep NameBasedDiff = D1 ('MetaData "NameBasedDiff" "U.Codebase.Branch.Diff" "unison-parser-typechecker-0.0.0-KNkVGbTXlis2lnVjsRIJUx" 'False) (C1 ('MetaCons "NameBasedDiff" 'PrefixI 'True) (S1 ('MetaSel ('Just "terms") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Relation Reference Reference)) :*: S1 ('MetaSel ('Just "types") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Relation Reference Reference))))

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.

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.