Commit Graph

287 Commits

Author SHA1 Message Date
Mitchell Rosen
65fccf5eff remove unison-hashable package, move Relation instances into Unison.Hashable 2021-10-05 22:18:18 -04:00
Mitchell Rosen
5605c2d20b Revert "rename accumulate' to hash, to become more similar to U.Util.Hashable"
This reverts commit e3ae0274d6.
2021-10-05 22:05:15 -04:00
Mitchell Rosen
e3ae0274d6 rename accumulate' to hash, to become more similar to U.Util.Hashable 2021-10-05 18:23:43 -04:00
Mitchell Rosen
e00c2cdb02 add unison-hashable, unison-prelude, unison-util-relation packages 2021-10-05 17:54:01 -04:00
Mitchell Rosen
e49f3e1d01 file renames 2021-10-05 11:08:01 -04:00
Mitchell Rosen
1748d6f8c0 document and improve performance of innerJoinRanMultimaps 2021-10-04 21:48:43 -04:00
mergify[bot]
d048205d98
Merge pull request #2433 from unisonweb/topic/hash-module-v1b
extract hashing modules
2021-09-24 19:25:09 +00:00
Rúnar
2a27e55c6f Determine if a delayed term is a block 2021-09-24 14:27:00 -04:00
Arya Irani
c2f8fbe803 Merge remote-tracking branch 'origin/trunk' into topic/hash-module-v1b
# Conflicts:
#	parser-typechecker/src/Unison/Codebase.hs
#	unison-core/src/Unison/Type.hs
2021-09-24 14:08:54 -04:00
Arya Irani
d387465334 remove some commented code and imports 2021-09-23 15:41:33 -04:00
Arya Irani
493748925d formatting 2021-09-23 15:40:16 -04:00
Arya Irani
5eeb95062b remove some commented code and imports 2021-09-23 15:37:12 -04:00
Arya Irani
f4cdaba953 split out Hashing.V2 and use that for the application
it's not finalized yet; it will still change when we update it to not include reference cycle length
2021-09-23 14:15:52 -04:00
Alvaro Carrasco
1c0d51caa3 Added STM to the list of built-in abilities reported by the server 2021-09-20 13:59:59 -06:00
Arya Irani
22f07823d0 Hashing.V1.Convert.hashDecls 2021-09-09 15:28:40 -04:00
Rúnar
63bc75ea34
Merge pull request #2382 from unisonweb/fix/2353
Fix to subtle name resolution bug that results in using TDNR unexpectedly
2021-09-07 10:08:41 -04:00
Paul Chiusano
eb483a32eb rename function 2021-09-02 20:59:40 -05:00
Paul Chiusano
7ea5b8b960 Fix #2353 2021-09-02 18:55:27 -05:00
Stew O'Connor
f252f4f39d Add missing Eq case for Pattern.Char
fixes: #2345
2021-09-01 16:22:09 -07:00
Arya Irani
81a32fc894 formatting and deleting commented-out code 2021-08-30 20:32:02 -04:00
Arya Irani
9d6d007c58 cleanup unused code warnings 2021-08-30 15:31:27 -04:00
Arya Irani
5dc190cffc Merge remote-tracking branch 'origin/trunk' into topic/weed-codebase1-5
# Conflicts:
#	parser-typechecker/src/Unison/Codebase.hs
#	parser-typechecker/src/Unison/Codebase/Editor/HandleCommand.hs
#	parser-typechecker/src/Unison/PrettyPrintEnv.hs
#	parser-typechecker/unison/Main.hs
#	unison-core/src/Unison/Names3.hs
#	unison-core/src/Unison/Pattern.hs
#	unison-core/src/Unison/Term.hs
#	unison-core/src/Unison/Type.hs
#	unison-core/src/Unison/Util/Relation.hs
#	unison-core/unison-core1.cabal
2021-08-30 14:11:14 -04:00
Arya Irani
2f13ea1f84 stripping and unknotting some stuff
- 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`?
2021-08-30 12:17:26 -04:00
Dan Doel
5c0f7deae3 Add mutable refs in scoped and IO variants 2021-08-24 12:03:16 -04:00
Dan Doel
ed3b1402e0 Only elide covariant variables in removePureEffects 2021-08-19 15:49:52 -04:00
Simon Højberg
fd87063885 Add a ucm ui command to open the Codebase UI
Add a command, `ui`, that opens the Codebase UI with the current
codebase server URL.
2021-08-18 10:16:46 -04:00
Paul Chiusano
ebdfbd99dc
Merge pull request #2292 from unisonweb/topic/substring-fzf
Case insensitive substring matching used as pre-filter to fzf
2021-08-11 09:42:45 -04:00
Paul Chiusano
83c43f1063 added some more comments 2021-08-05 10:08:25 -04:00
Paul Chiusano
79abf6aa6c Case insensitive substring matching used as pre-filter to fzf 2021-08-04 11:53:24 -04:00
Paul Chiusano
5bc719944e Fix wildcard imports regression and re-add test for it 2021-08-04 10:42:35 -04:00
Paul Chiusano
b478767aff Make suffixify0 a local definition, as it was just used in 1 spot
And we want to discourage doing that sort of thing now that names directly support suffix-based lookup
2021-08-03 22:13:14 -04:00
Paul Chiusano
64c57bb189 Avoid returning absolute names unless there are no other options 2021-08-03 16:51:04 -04:00
Paul Chiusano
0527874d97 remove unused import 2021-08-03 13:00:17 -04:00
Paul Chiusano
3bb3f752fd Fixup name resolution precedence and add comments 2021-08-03 12:59:04 -04:00
Paul Chiusano
b3f376b857 Refactoring common logic into Name.searchBySuffix 2021-08-03 11:43:33 -04:00
Paul Chiusano
85330ee199 redo sorting of names 2021-08-02 23:03:56 -04:00
Paul Chiusano
9c08000938 tweaks to ordering 2021-08-02 17:50:12 -04:00
Paul Chiusano
df24879407 fix bug in reverse segments and add unit test 2021-08-02 14:55:40 -04:00
Paul Chiusano
39431a401d Introduce Alphabetical typeclass - alphabetical ordering for humans
Previously, we were very sloppy, sometimes using the Ord instance for things displayed to humans, when that is only sometimes kinda sorta what you want. Separating this out into its own class lets us be careful about this and handle it uniformly.
2021-08-02 11:11:22 -04:00
Paul Chiusano
41b8068b43 Fix name comparison to take into account absolute names
Transcripts all pass, but have a lot of diffs that I need to investigate
2021-08-01 17:49:24 -04:00
Paul Chiusano
d10adcf0fb similar fix to type symbol resolution 2021-08-01 00:55:12 -04:00
Paul Chiusano
1023618546 Ensure symbol resolution inside terms uses lookupHQTerm/Type
rather than using relational operations directly
2021-08-01 00:27:15 -04:00
Paul Chiusano
383b07c65c resurrected suffixify and tweaked lookupHQTerm/Type to be able to prefer unique suffixes in the current file 2021-07-31 23:59:58 -04:00
Paul Chiusano
1fe6c67b4b Use Name.searchBySuffix rather than directly calling relation functions 2021-07-31 23:08:02 -04:00
Paul Chiusano
bc134c8612 remove Names.suffixify 2021-07-31 23:01:52 -04:00
Paul Chiusano
0d6de603bb lookupHQTerm and lookupHQType now do suffix-based resolution
Added some helper functions and additional docs to `Name` module
2021-07-31 14:45:54 -04:00
Paul Chiusano
33e7d7783c suffixTerm/TypeName are now responsible for sorting output 2021-07-31 00:19:21 -04:00
Paul Chiusano
9d662725e9 (untested) create suffixed pretty print environment directly from names 2021-07-30 23:55:11 -04:00
Paul Chiusano
7d72669a60 Relation.searchDom/Ran and unit test 2021-07-30 22:06:42 -04:00
Paul Chiusano
52c612d132 experimental sorting of names by suffix 2021-07-30 17:10:48 -04:00