Skip to content

off-by-one namespace layout #5539

Open
Open
@aryairani

Description

Currently we have:

data Namespace = 
  Namespace {
    terms :: Relation NameSegment TermReference,
    types :: Relation NameSegment TypeReference,
    children :: Map NameSegment NamespaceHash
  }

This avoids unnamed definitions at the root, because all definitions need at least one NameSegment.

but we could have had

data Namespace =
  Namespace {
    terms :: Set TermReference,
    types :: Set TypeReference,
    children :: Map NameSegment NamespaceHash
  }

The latter simplifies some operations, such as finding, moving, or deleting all the definitions with a certain prefix.

We can link related issues to this ticket.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions