Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Mergeblob0 libdep = Mergeblob0 {
- defns :: ThreeWay (Defns (BiMultimap Referent Name) (BiMultimap TypeReference Name))
- libdeps :: ThreeWay (Map NameSegment libdep)
- nametrees :: ThreeWay (Nametree (DefnsF (Map NameSegment) Referent TypeReference))
- makeMergeblob0 :: ThreeWay (Nametree (DefnsF (Map NameSegment) Referent TypeReference)) -> ThreeWay (Map NameSegment libdep) -> Mergeblob0 libdep
- data Mergeblob1 libdep = Mergeblob1 {
- conflicts :: TwoWay (DefnsF (Map Name) TermReference TypeReference)
- declNameLookups :: TwoWay DeclNameLookup
- defns :: ThreeWay (Defns (BiMultimap Referent Name) (BiMultimap TypeReference Name))
- diff :: DefnsF2 (Map Name) CombinedDiffOp Referent TypeReference
- diffs :: TwoWay (DefnsF3 (Map Name) DiffOp Synhashed Referent TypeReference)
- hydratedDefns :: ThreeWay (DefnsF (Map Name) (TermReferenceId, (Term Symbol Ann, Type Symbol Ann)) (TypeReferenceId, Decl Symbol Ann))
- lcaDeclNameLookup :: PartialDeclNameLookup
- libdeps :: Map NameSegment libdep
- libdepsDiff :: Map NameSegment (LibdepDiffOp libdep)
- lcaLibdeps :: Map NameSegment libdep
- unconflicts :: DefnsF Unconflicts Referent TypeReference
- makeMergeblob1 :: forall libdep. Eq libdep => Mergeblob0 libdep -> ThreeWay (DefnsF (Map Name) (TermReferenceId, (Term Symbol Ann, Type Symbol Ann)) (TypeReferenceId, Decl Symbol Ann)) -> Either (EitherWay IncoherentDeclReason) (Mergeblob1 libdep)
- data Mergeblob2 libdep = Mergeblob2 {
- conflicts :: TwoWay (DefnsF (Map Name) TermReferenceId TypeReferenceId)
- coreDependencies :: TwoWay (DefnsF Set TermReference TypeReference)
- declNameLookups :: TwoWay DeclNameLookup
- defns :: ThreeWay (Defns (BiMultimap Referent Name) (BiMultimap TypeReference Name))
- hasConflicts :: Bool
- hydratedDefns :: ThreeWay (DefnsF (Map Name) (TermReferenceId, (Term Symbol Ann, Type Symbol Ann)) (TypeReferenceId, Decl Symbol Ann))
- lcaDeclNameLookup :: PartialDeclNameLookup
- lcaLibdeps :: Map NameSegment libdep
- libdeps :: Map NameSegment libdep
- soloUpdatesAndDeletes :: TwoWay (DefnsF Set Name Name)
- unconflicts :: DefnsF Unconflicts Referent TypeReference
- data Mergeblob2Error
- makeMergeblob2 :: Mergeblob1 libdep -> Either Mergeblob2Error (Mergeblob2 libdep)
- data Mergeblob3 = Mergeblob3 {}
- makeMergeblob3 :: Mergeblob2 libdep -> TwoWay (DefnsF Set TermReferenceId TypeReferenceId) -> Names -> Names -> TwoWay Text -> Mergeblob3
- data Mergeblob4 = Mergeblob4 {}
- makeMergeblob4 :: Mergeblob3 -> Either (Err Symbol) Mergeblob4
- data Mergeblob5 = Mergeblob5 {}
- makeMergeblob5 :: Mergeblob4 -> TypeLookup Symbol Ann -> Either (Seq (Note Symbol Ann)) Mergeblob5
- data PartialDeclNameLookup = PartialDeclNameLookup {
- constructorToDecl :: !(Map Name Name)
- declToConstructors :: !(Map Name [Maybe Name])
- data IncoherentDeclReason
- checkDeclCoherency :: HasCallStack => Nametree (DefnsF (Map NameSegment) Referent TypeReference) -> Map TypeReferenceId Int -> Either IncoherentDeclReason DeclNameLookup
- lenientCheckDeclCoherency :: Nametree (DefnsF (Map NameSegment) Referent TypeReference) -> Map TypeReferenceId Int -> PartialDeclNameLookup
- data IncoherentDeclReasons = IncoherentDeclReasons {
- constructorAliases :: ![(Name, Name, Name)]
- missingConstructorNames :: ![Name]
- nestedDeclAliases :: ![(Name, Name)]
- strayConstructors :: ![(TypeReferenceId, Name)]
- checkAllDeclCoherency :: forall m. Monad m => (TypeReferenceId -> m Int) -> Nametree (DefnsF (Map NameSegment) Referent TypeReference) -> m (Either IncoherentDeclReasons DeclNameLookup)
- data CombinedDiffOp a
- = CombinedDiffOp'Add !(EitherWayI a)
- | CombinedDiffOp'Delete !(EitherWayI a)
- | CombinedDiffOp'Update !(EitherWayI (Updated a))
- | CombinedDiffOp'Conflict !(TwoWay a)
- data DiffOp a
- = DiffOp'Add !a
- | DiffOp'Delete !a
- | DiffOp'Update !(Updated a)
- data EitherWay a
- data EitherWayI a
- = OnlyAlice a
- | OnlyBob a
- | AliceAndBob a
- data LibdepDiffOp a
- = AddLibdep !a
- | AddBothLibdeps !a !a
- | DeleteLibdep
- data Synhashed a = Synhashed {}
- data ThreeWay a = ThreeWay {}
- data TwoOrThreeWay a = TwoOrThreeWay {}
- data TwoWay a = TwoWay {}
- data TwoWayI a = TwoWayI {}
- data Unconflicts v = Unconflicts {}
- data Updated a = Updated {}
Documentation
data Mergeblob0 libdep Source #
Mergeblob0 | |
|
makeMergeblob0 :: ThreeWay (Nametree (DefnsF (Map NameSegment) Referent TypeReference)) -> ThreeWay (Map NameSegment libdep) -> Mergeblob0 libdep Source #
data Mergeblob1 libdep Source #
Mergeblob1 | |
|
makeMergeblob1 :: forall libdep. Eq libdep => Mergeblob0 libdep -> ThreeWay (DefnsF (Map Name) (TermReferenceId, (Term Symbol Ann, Type Symbol Ann)) (TypeReferenceId, Decl Symbol Ann)) -> Either (EitherWay IncoherentDeclReason) (Mergeblob1 libdep) Source #
data Mergeblob2 libdep Source #
Mergeblob2 | |
|
data Mergeblob2Error Source #
makeMergeblob2 :: Mergeblob1 libdep -> Either Mergeblob2Error (Mergeblob2 libdep) Source #
data Mergeblob3 Source #
makeMergeblob3 :: Mergeblob2 libdep -> TwoWay (DefnsF Set TermReferenceId TypeReferenceId) -> Names -> Names -> TwoWay Text -> Mergeblob3 Source #
data Mergeblob4 Source #
makeMergeblob4 :: Mergeblob3 -> Either (Err Symbol) Mergeblob4 Source #
makeMergeblob5 :: Mergeblob4 -> TypeLookup Symbol Ann -> Either (Seq (Note Symbol Ann)) Mergeblob5 Source #
Decl coherency checks
data PartialDeclNameLookup Source #
Like a DeclNameLookup
, but "partial" / more lenient - because we don't require the LCA of a merge to have a full
DeclNameLookup
.
PartialDeclNameLookup | |
|
Instances
Generic PartialDeclNameLookup Source # | |
Defined in Unison.Merge.PartialDeclNameLookup type Rep PartialDeclNameLookup :: Type -> Type # | |
type Rep PartialDeclNameLookup Source # | |
Defined in Unison.Merge.PartialDeclNameLookup type Rep PartialDeclNameLookup = D1 ('MetaData "PartialDeclNameLookup" "Unison.Merge.PartialDeclNameLookup" "unison-merge-0.0.0-FjcytY06jxd3ECqvfsdKaz" 'False) (C1 ('MetaCons "PartialDeclNameLookup" 'PrefixI 'True) (S1 ('MetaSel ('Just "constructorToDecl") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map Name Name)) :*: S1 ('MetaSel ('Just "declToConstructors") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map Name [Maybe Name])))) |
data IncoherentDeclReason Source #
IncoherentDeclReason'ConstructorAlias !Name !Name !Name | A second naming of a constructor was discovered underneath a decl's name, e.g. |
IncoherentDeclReason'MissingConstructorName !Name | |
IncoherentDeclReason'NestedDeclAlias !Name !Name | A second naming of a decl was discovered underneath its name, e.g. Foo#Foo Foo.Bar#Foo |
IncoherentDeclReason'StrayConstructor !TypeReferenceId !Name |
Instances
Show IncoherentDeclReason Source # | |
Defined in Unison.Merge.DeclCoherencyCheck showsPrec :: Int -> IncoherentDeclReason -> ShowS # show :: IncoherentDeclReason -> String # showList :: [IncoherentDeclReason] -> ShowS # |
checkDeclCoherency :: HasCallStack => Nametree (DefnsF (Map NameSegment) Referent TypeReference) -> Map TypeReferenceId Int -> Either IncoherentDeclReason DeclNameLookup Source #
lenientCheckDeclCoherency :: Nametree (DefnsF (Map NameSegment) Referent TypeReference) -> Map TypeReferenceId Int -> PartialDeclNameLookup Source #
A lenient variant of checkDeclCoherency
- so lenient it can't even fail! It returns partial decl name lookup,
which doesn't require a name for every constructor, and allows a constructor with a nameless decl.
This function exists merely to extract a best-effort name mapping for the LCA of a merge. We require Alice and Bob to have coherent decls, but their LCA is out of the user's control and may have incoherent decls, and whether or not it does, we still need to compute *some* syntactic hash for its decls.
data IncoherentDeclReasons Source #
IncoherentDeclReasons | |
|
Instances
checkAllDeclCoherency :: forall m. Monad m => (TypeReferenceId -> m Int) -> Nametree (DefnsF (Map NameSegment) Referent TypeReference) -> m (Either IncoherentDeclReasons DeclNameLookup) Source #
Like checkDeclCoherency
, but returns info about all of the incoherent decls found, not just the first.
Types
data CombinedDiffOp a Source #
The combined result of two diffs on the same thing.
CombinedDiffOp'Add !(EitherWayI a) | |
CombinedDiffOp'Delete !(EitherWayI a) | |
CombinedDiffOp'Update !(EitherWayI (Updated a)) | |
CombinedDiffOp'Conflict !(TwoWay a) |
Instances
Functor CombinedDiffOp Source # | |
Defined in Unison.Merge.CombineDiffs fmap :: (a -> b) -> CombinedDiffOp a -> CombinedDiffOp b # (<$) :: a -> CombinedDiffOp b -> CombinedDiffOp a # | |
Show a => Show (CombinedDiffOp a) Source # | |
Defined in Unison.Merge.CombineDiffs showsPrec :: Int -> CombinedDiffOp a -> ShowS # show :: CombinedDiffOp a -> String # showList :: [CombinedDiffOp a] -> ShowS # |
A diff operation is one of:
- An add (where nothing was)
- A delete (of the thing that was)
- An update (from old to new)
DiffOp'Add !a | |
DiffOp'Delete !a | |
DiffOp'Update !(Updated a) |
Instances
Alice exclusive-or Bob?
data EitherWayI a Source #
Alice inclusive-or Bob?
OnlyAlice a | |
OnlyBob a | |
AliceAndBob a |
Instances
Functor EitherWayI Source # | |
Defined in Unison.Merge.EitherWayI fmap :: (a -> b) -> EitherWayI a -> EitherWayI b # (<$) :: a -> EitherWayI b -> EitherWayI a # | |
Show a => Show (EitherWayI a) Source # | |
Defined in Unison.Merge.EitherWayI showsPrec :: Int -> EitherWayI a -> ShowS # show :: EitherWayI a -> String # showList :: [EitherWayI a] -> ShowS # |
data LibdepDiffOp a Source #
AddLibdep !a | |
AddBothLibdeps !a !a | |
DeleteLibdep |
A small utility type that represents a syntactic-hashed thing.
Instances
Functor Synhashed Source # | |
Generic (Synhashed a) Source # | |
Show a => Show (Synhashed a) Source # | |
Eq (Synhashed a) Source # | |
Ord (Synhashed a) Source # | |
Defined in Unison.Merge.Synhashed | |
type Rep (Synhashed a) Source # | |
Defined in Unison.Merge.Synhashed type Rep (Synhashed a) = D1 ('MetaData "Synhashed" "Unison.Merge.Synhashed" "unison-merge-0.0.0-FjcytY06jxd3ECqvfsdKaz" 'False) (C1 ('MetaCons "Synhashed" 'PrefixI 'True) (S1 ('MetaSel ('Just "hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Hash) :*: S1 ('MetaSel ('Just "value") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a))) |
Instances
data TwoOrThreeWay a Source #
Instances
Instances
"Two-way inclusive".
Instances
data Unconflicts v Source #
Instances
An updated thing.
Instances
Functor Updated Source # | |
Generic (Updated a) Source # | |
Show a => Show (Updated a) Source # | |
type Rep (Updated a) Source # | |
Defined in Unison.Merge.Updated type Rep (Updated a) = D1 ('MetaData "Updated" "Unison.Merge.Updated" "unison-merge-0.0.0-FjcytY06jxd3ECqvfsdKaz" 'False) (C1 ('MetaCons "Updated" 'PrefixI 'True) (S1 ('MetaSel ('Just "old") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Just "new") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) |