- moved everything that depended on V1 `Reference` into `FileCodebase` namespace, duplicating a lot of code for better or worse.
- pulled these into their own modules:
- Codebase (types) into `Codebase.Type`; `Codebase` module re-exports them
- `Codebase.Branch.Merge`,
- `Codebase.Branch.Names` (Branch shouldn't depend on `Names`)
- `Codebase.BuiltinAnnotation`
- `Codebase.Causal.FoldHistory`
- `Codebase.CodeLookup.Util` (remove `CodeLookup` dependency on `UnisonFile`)
- `Codebase.DataDeclaration.ConstructorId` trying to use this alias in relevant places
- `Codebase.Init`
- `CodebasePath`, the `FilePath` alias.
- `Lexer.Pos` (because `AnnotatedText`, `Range`, `Parser.Ann` shouldn't depend on the whole lexer)
- `Names.ResolutionResult` (`Type` shouldn't depend on `Names`)
- `PrettyPrintEnv.FQN`
- `PrettyPrintEnv.Names` (pulled out references to `Names` from `PPE`)
- `PPE.Util` not 100% sure what's happening here
- `PrettyPrintEnvDecl` pull this data type and supporting functions into separate module
- `Path.Parse` (`Path` shouldn't depend on the lexer)
- `Path.Convert`, `Path.Parse` into `Unison.Util.Convert`
- `Parser.Ann` (`Codebase`, etc. etc. shouldn't depend on `Parser`)
- `Referent'` (`SyntaxText`/`ColorText` shouldn't depend on `Reference`)
- `Referent` module re-exports stuff from `Referent'`, hard-coded to `Reference`.
- removed `SyntaxText.SyntaxText`
- `TermEdit.Typing` (because `TermEdit` shouldn't depend on the full typechecker)
- `UnisonFile` / `TypecheckedUnisonFile` (types into `UnisonFile.Type`)
- `UnisonFile.Env`
- `UnisonFile.Error`
- `UnisonFile.Names`
- `Var.WatchKind`
- `Var.refNamed`
- Deleted unused `Codebase.Classes` typeclasses wip
- Deleted unused `Unison.Util.Menu`, ancient modal stuff
- Moved `Codebase.makeSelfContained` into `UnisonFile` module, since it deals with `UnisonFile` and not with `Codebase`.
- split up `GitError` into a more codebase-agnostic hierarchy (see `Codebase.Type.GitError`)
- changed `bindNames` to `bindReferences` in some cases; `bindNames` remains in `.Names` compatibility module
- move `Unison.Var.refNamed` into `Unison.Term`
- tweaked GitError to separate obviously codebase-format specific errors from non-obviously-corbase-format-specific errors.
- tweaked `Reflog.Entry` to support anything that's coercible to `Unison.Hash`, but also changed its kind
- removed `DebugBranchHistoryI` input because I didn't want to maintain its implementation
- removed `ShortBranchHash` dependency on `Hash`, and let it work on anything coercible to `Hash`. P.S./todo This class should be called ShortHash; the existing ShortHash is really a ShortReference!
- removed SyntaxText dependency on Reference
- cleaned up `Path` somewhat
- held off on:
- move `DD.updateDependencies`
- splitting up `Path` into the billion different components
- e.g. `Path` becomes `RelativePath`, `Path'` becomes `Path`, and `Absolute` wraps `RelativePath`
- `Split` / `Split'` maybe rename to `Path.NonEmpty`?
- rename `Branch.getPatch` / `.getMaybePatch`
- split out `Name.Parse`, `Name.Convert`, substitute a lot of specific functions like `Path.hqSplitFromName'` with `Convert.parse`.
- todo:
- clear unreferenced junk
- restore:
- `NameEdit`?
- `PatternCompat`?
motivation: you can read from any "write" uri, but not write to any "read" uri (it may contain a read-only hash)
eliminates a lot of error code, but adds a lot of discrimination code
- Match branches do some context manipulation which can cause
existentials to be dropped from the context even though they are still
necessary to make sense of the wanted abilities. This change re-adds
those existentials to the context to ensure that the abilities remain
sensical.
- Handling concrete ability unification before variables seems more
likely to produce good results, since the concrete ability equality is
more restrictive about how variables must behave, and will narrow
things down more.
- The code was calculating `Reference` values that are missing from the
value that it tried to load, and was sending them back directly as
term links. However, a term link is a `Referent`, and the reference
must be wrapped in an additional constructor. Since things get
coerced, this led to segfaults.