| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Unison.PartialDeclNameLookup
Synopsis
- data PartialDeclNameLookup = PartialDeclNameLookup {
- constructorToDecl :: !(Map Name Name)
- declToConstructors :: !(Map Name [Maybe Name])
- empty :: PartialDeclNameLookup
- expectDeclName :: HasCallStack => PartialDeclNameLookup -> Name -> Name
- expectConstructorNames :: HasCallStack => PartialDeclNameLookup -> Name -> [Maybe Name]
- toDeclNameLookup :: (Text -> Name) -> PartialDeclNameLookup -> DeclNameLookup
- fromDeclNameLookup :: DeclNameLookup -> PartialDeclNameLookup
Documentation
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.
Constructors
| PartialDeclNameLookup | |
Fields
| |
Instances
expectDeclName :: HasCallStack => PartialDeclNameLookup -> Name -> Name Source #
expectConstructorNames :: HasCallStack => PartialDeclNameLookup -> Name -> [Maybe Name] Source #
toDeclNameLookup :: (Text -> Name) -> PartialDeclNameLookup -> DeclNameLookup Source #
Turn a partial decl name lookup into a total decl name lookup.
This isn't very sensible, but in certain cases we do find ourselves in the unfortunate circumstance of needing to render a type declaration that doesn't have a name for one or more of its constructors (as when rendering the LCA file of a difftool or mergetool, since we do allow the LCA to have missing constructors).
This function just assigns bogus names like Unnamed for rendering.