Commit Graph

397 Commits

Author SHA1 Message Date
Arya Irani
281a657166 wip v1 > v2 conversion 2021-03-22 16:03:30 -04:00
Arya Irani
eebd3b8b6a wip v1 > v2 conversion 2021-03-19 14:36:32 -04:00
Paul Chiusano
42bc5d55aa Merge remote-tracking branch 'origin/trunk' into topic/doc2 2021-03-15 15:34:58 -05:00
Arya Irani
d1ddcfef45 Merge remote-tracking branch 'origin/trunk' into wip/codebase2
# Conflicts:
#	parser-typechecker/src/Unison/Codebase.hs
#	parser-typechecker/src/Unison/Codebase/Branch.hs
#	parser-typechecker/src/Unison/Codebase/Editor/HandleCommand.hs
#	parser-typechecker/tests/Unison/Test/ANF.hs
#	parser-typechecker/unison-parser-typechecker.cabal
#	parser-typechecker/unison/Main.hs
#	stack.yaml
2021-03-10 13:57:04 -05:00
Arya Irani
28f48be943 split out git-specific vs filecodebase-specific git code
also MonadIO'ed stuff
2021-03-09 11:48:58 -05:00
Paul Chiusano
f941687229
Merge pull request #1827 from nini-faroux/seq-list 2021-03-06 06:51:38 -06:00
Ian Grant Jeffries
7ee453af18 Add some Haddocks for key declarations 2021-03-04 18:14:23 -05:00
ninifaroux
f4b8e87258 add consistent list naming 2021-03-03 19:19:47 +00:00
Paul Chiusano
8465458625 sync with trunk 2021-03-02 10:20:28 -06:00
runarorama
dcc8954fe5 Revert Referent data constructors 2021-02-24 22:58:22 -05:00
Dan Doel
e25c6ea34a Merge branch 'trunk' into topic/abilities-fixes 2021-02-23 14:29:29 -05:00
Arya Irani
11a9d60515 term1to2 was encoding Term.Request as Constructor 2021-02-12 15:27:37 -05:00
Arya Irani
93968af9ad Merge remote-tracking branch 'origin/trunk' into wip/codebase2
but IO.handleOPs fails
# Conflicts:
#	parser-typechecker/src/Unison/Builtin.hs
#	parser-typechecker/src/Unison/Builtin/Decls.hs
#	parser-typechecker/src/Unison/Builtin/Terms.hs
#	parser-typechecker/src/Unison/Codebase.hs
#	parser-typechecker/src/Unison/Codebase/Editor/HandleInput.hs
#	parser-typechecker/unison-parser-typechecker.cabal
#	unison-src/transcripts/isPropagated-exists.md
#	unison-src/transcripts/isPropagated-exists.output.md
2021-02-11 21:59:26 -05:00
runarorama
86b1330e0a Serve FQNs and "best name" along with definition. 2021-02-10 21:40:17 -05:00
Paul Chiusano
c834904a38 Implement (untested) TermParser changes
Found a decent way of expressing so there's not much duplication between lexer and parser.
Still todo: example syntax, and make names consistent between lexer and parser
Still todo: syntax for docs on top level bindings
2021-02-10 18:03:02 -06:00
runarorama
9f0c8061fe Merge branch 'trunk' of github.com:unisonweb/unison into topic/codebaseserver-openapi 2021-02-08 13:23:52 -05:00
Dan Doel
fd743d3dce Merge remote-tracking branch 'origin/trunk' into topic/abilities-fixes 2021-01-28 16:57:03 -05:00
Stew O'Connor
258ec6357f Add an Any parameter to the Failure type 2021-01-28 13:57:03 -08:00
runarorama
ba7e8c9f70 Merge branch 'trunk' of github.com:unisonweb/unison into topic/codebaseserver-openapi 2021-01-28 16:20:29 -05:00
runarorama
d1920dc2fe wip 2021-01-27 15:36:23 -05:00
Stew O'Connor
17fe0e6e19 Merge remote-tracking branch 'origin/trunk' into stew/tls-testing 2021-01-23 01:25:52 -08:00
Stew O'Connor
71aeeee669 tls tests are working woot 2021-01-23 00:57:23 -08:00
Dan Doel
ac9c4a48f1 First pass adding/implementing STM builtins
- Not working as of yet
2021-01-12 16:56:01 -05:00
Arya Irani
191413a21c unchange old reference hashing 2021-01-12 10:28:56 -05:00
Arya Irani
a72e59eb66 Merge branch 'trunk' into wip/codebase2 2021-01-11 22:40:41 -05:00
runarorama
af091f3f07 Merge branch 'trunk' of github.com:unisonweb/unison into topic/codebaseserver-openapi 2021-01-08 11:40:52 -05:00
runarorama
c5bc998b03 Integrate backend into servant server 2021-01-08 11:39:54 -05:00
runarorama
3a1cf635b5 Merge branch 'trunk' of github.com:unisonweb/unison into topic/codebaseserver-openapi 2021-01-04 14:33:16 -05:00
Paul Chiusano
84e10dd436 Merge remote-tracking branch 'origin/trunk' into topic/abilities-fixes
# Conflicts:
#	parser-typechecker/src/Unison/Typechecker/Context.hs
2021-01-04 14:20:19 -05:00
Arya Irani
e2df2eff3e update trunk for ghc 8.10.2 2020-12-22 11:58:24 -05:00
Stew O'Connor
a648ac879f Merge remote-tracking branch 'origin/trunk' into stew/tls-testing 2020-12-15 11:45:38 -08:00
Stew O'Connor
8ab3574ff1 Add the ability to configure an altrernate TLS CertificateStore 2020-12-15 11:17:57 -08:00
Paul Chiusano
75c8d3a53c non-working Any type 2020-12-10 14:25:19 -05:00
runarorama
6a94460c0c Merge branch 'trunk' of github.com:unisonweb/unison into topic/codebaseserver-openapi 2020-12-09 21:36:37 -05:00
Paul Chiusano
6b94ab70c8
Merge pull request #1766 from unisonweb/fix/ability-unification
A couple fixes to ability unification
2020-12-07 14:10:32 -05:00
Stew O'Connor
d1d09d9197 Merge branch 'trunk' into feature/tls 2020-12-02 15:22:01 -08:00
Dan Doel
73ed824f89 Modify strategy for completing data/effect signatures
- Previously we would complete data and effect signatures of
  the form:

    a -> b

  to ones of the form:

    a ->{e} b

  at use sites. Moreover, `e` would be a fresh unification variable for
  every use of the constructor/effect. This is clearly unsound.
- The new strategy completes to `a ->{} b`.
- Alternate strategies are possible, but they probably need to involve
  post-processing the declaration, rather than occurring at use-sites.
2020-12-01 14:43:53 -05:00
runarorama
fcd6fa30f6 Merge branch 'trunk' of github.com:unisonweb/unison into topic/codebaseserver-openapi 2020-12-01 13:08:15 -05:00
Paul Chiusano
d706550926
Merge pull request #1748 from unisonweb/topic/mobile-code
Finish implementing code serialization support
2020-11-24 17:27:56 -05:00
Dan Doel
f4c0c6bf0c Avoid parsing data/effect patterns that don't make sense
- The way of resolving constructors in patterns wasn't taking
  into account whether a data or ability constructor was expected,
  and was therefore sometimes parsing things like variables as
  data constructors with references to ability effects.
2020-11-23 16:34:37 -05:00
Stew O'Connor
34c284cc72 more things working, starting a transcript
- renamed many of the foreign calling confention functions

- fixed implementations of several IO functions

- added IO.createTempDirectory to create temporary directories which
  will be useful for testing

- started working on a transcript, but don't yet have a strategy for
  testing IO using transcripts
2020-11-13 12:25:21 -08:00
Dan Doel
40e2db5722 Merge branch 'trunk' into topic/mobile-code
- Fixes conflicts
2020-11-10 14:14:25 -05:00
runarorama
cba4cf36de Merge branch 'trunk' of github.com:unisonweb/unison into topic/codebaseserver-openapi 2020-11-10 12:44:03 -05:00
Dan Doel
b027ad67b4 Add code serialization API 2020-11-09 17:28:07 -05:00
Stew O'Connor
3e75459fc1 Merge remote-tracking branch 'origin/trunk' into feature/tls 2020-10-27 09:14:01 -07:00
Stew O'Connor
0b6be82ea7 Added Tls.Config.defaultClient and Tls.Config.defaultServer 2020-10-26 13:03:18 -07:00
Arya Irani
7ef216a87c SqliteCodebase.putTerm and helpers 2020-10-25 15:28:32 -04:00
Arya Irani
258acb906c added some MonadError 2020-10-25 02:35:26 -04:00
Arya Irani
d7f4a501b1 {term,decl}ReferencesByPrefix 2020-10-23 12:20:15 -04:00
Paul Chiusano
e784107d64 Implement fix. There were lots of tests that were inadvertently relying on the bug. 2020-10-22 22:33:12 -04:00
runarorama
a54136a39a Merge branch 'trunk' of github.com:unisonweb/unison into topic/codebaseserver-openapi 2020-10-22 20:53:09 -04:00
Paul Chiusano
54b59c1a2d okay, not too shabby 2020-10-21 22:42:35 -04:00
Arya Irani
8eb21adda0 wip 2020-10-21 21:34:43 -04:00
Arya Irani
29359b18a8 change hashing for refs, and add loadTermByHash 2020-10-20 13:27:43 -04:00
Arya Irani
279b6e876d Merge remote-tracking branch 'origin/trunk' into wip/codebase2
# Conflicts:
#	.travis.yml
#	parser-typechecker/src/Unison/Builtin.hs
#	parser-typechecker/src/Unison/Runtime/ANF.hs
#	parser-typechecker/src/Unison/Runtime/Builtin.hs
#	parser-typechecker/src/Unison/Runtime/Decompile.hs
#	parser-typechecker/src/Unison/Runtime/Foreign.hs
#	parser-typechecker/src/Unison/Runtime/Foreign/Function.hs
#	parser-typechecker/src/Unison/Runtime/MCode.hs
#	parser-typechecker/src/Unison/Runtime/Machine.hs
#	parser-typechecker/src/Unison/Runtime/Stack.hs
#	parser-typechecker/tests/Unison/Test/MCode.hs
#	unison-core/src/Unison/Type.hs
#	unison-src/new-runtime-transcripts/hashing.md
#	unison-src/new-runtime-transcripts/hashing.output.md
#	unison-src/transcripts/alias-many.output.md
#	unison-src/transcripts/emptyCodebase.output.md
#	unison-src/transcripts/merges.output.md
#	unison-src/transcripts/reflog.output.md
#	unison-src/transcripts/squash.output.md
2020-10-19 13:43:16 -04:00
Arya Irani
22f07828d0 wip 2020-10-19 10:17:25 -04:00
Paul Chiusano
29e4d6dc5d Define sortNamed in terms of sortByText rather than the other way around 2020-10-16 17:47:22 -04:00
Paul Chiusano
f4c866e3cf fix #1542 2020-10-16 17:40:29 -04:00
Arya Irani
f59d9cd0fa wip; next is add term to index 2020-10-13 16:54:08 -04:00
Paul Chiusano
7b2a2384eb Corresponding pretty-printer changes.
Moved some pretty-printer specific patterns and helper functions into TermPrinter
2020-10-09 15:02:27 -04:00
runarorama
debd1bcf6c May as well rename HashQualified' everywhere 2020-10-09 14:46:54 -04:00
runarorama
2f3ec519f5 OpenAPI doesn't like names with ' in them 2020-10-09 14:24:57 -04:00
Paul Chiusano
8186cb11f7
Merge pull request #1712 from unisonweb/topic/basic-hashing
Cryptographic primitives for hashing and HMAC
2020-10-08 16:03:26 -04:00
mergify[bot]
136a0cc990
Merge pull request #1716 from unisonweb/topic/relax-var-constraint-on-hashComponent
relax Var constraint on a few ABT functions
2020-10-07 22:22:34 +00:00
Arya Irani
470e318659 relax Var constraint on a few ABT functions 2020-10-07 16:59:35 -04:00
runarorama
0c1f4008db Merge branch 'trunk' of github.com:unisonweb/unison into topic/codebaseserver 2020-10-06 14:24:21 -04:00
Paul Chiusano
1447b0a2cd Merge remote-tracking branch 'origin/trunk' into topic/hashing 2020-10-02 11:26:01 -04:00
Paul Chiusano
af9190ee22 simplify API - not supporting streaming hashing / hmac for now as serializing / decompiling the hash / hmac state is a can of worms 2020-10-02 11:02:24 -04:00
Paul Chiusano
71ff9f7c48
Merge pull request #1706 from unisonweb/topic/mobile-code
Pull in some changes from the mobile code development
2020-10-01 18:45:10 -04:00
Paul Chiusano
f17fafb27f Reworked API some more. It's looking good. Still testing left to do. 2020-10-01 18:41:49 -04:00
Dan Doel
44a9010c6b Closed term hashing helper function 2020-10-01 14:27:18 -04:00
Paul Chiusano
25a2e43071 Greatly simplified hashing API and support decompilation of hashing contexts. In prep for HMAC implementation. 2020-10-01 12:46:18 -04:00
runarorama
60b0b7e8ed Merge branch 'trunk' of github.com:unisonweb/unison into topic/codebaseserver 2020-09-30 23:21:55 -04:00
runarorama
2c4545564d wip 2020-09-30 23:21:29 -04:00
Paul Chiusano
91220df8fc Merge remote-tracking branch 'origin/trunk' into topic/hashing 2020-09-30 18:51:11 -04:00
Paul Chiusano
27173e5cc6 Something implemented and runs for Sha3{512,256}, Sha2{512,256}, Blake2b{512,256}, Blake2s{256}. Still pending work from @dolio for the universal hashing functions. 2020-09-30 17:14:25 -04:00
Paul Chiusano
8e1cb8129b WIP on sha3 hashing 2020-09-29 18:57:32 -04:00
Paul Chiusano
34df8d7400 some cleanup and docs 2020-09-28 15:14:10 -04:00
Paul Chiusano
81f51fc646 Updated pretty-printer to use destructuring bind syntax, and updated pretty-printer tests. 2020-09-28 12:30:36 -04:00
Paul Chiusano
20c8cacf1f WIP on destructuring bind.
Currently disabled in the parser (see comment inside the block parser), but had to switch off namespace parsing which caused IOSource to no longer work. Currently working through errors there, might just disable IOSource temporarily.
2020-09-27 16:07:36 -04:00
Paul Chiusano
d27b0194b2 Merge branch 'trunk' into topic/destructuring-bind 2020-09-27 14:14:47 -04:00
Paul Chiusano
289fc3e175 Merge remote-tracking branch 'origin/trunk' into topic/abilities-fixes 2020-09-22 17:13:52 -04:00
Arya Irani
49328bb25e codebase2 wip; temporarily deleted old packages to improve hls startup 2020-09-15 12:28:28 -04:00
Dan Doel
0304b3620a Builtin adding tutorial with associated MVar ops
- Some refactoring in the Unison.Builtin module to make things a bit
  more pleasant.
2020-09-03 13:38:09 -04:00
Dan Doel
d555693423 Merge branch 'trunk' into wip/rt2 2020-08-19 10:59:08 -04:00
Paul Chiusano
4180e3e226 noncompiling WIP 2020-08-16 15:13:09 -04:00
Paul Chiusano
04eb051a8f
Merge pull request #1655 from jaredly/pretty-syntax
Add information to SyntaxText to enable hyperlinked source
2020-08-16 12:31:40 -04:00
Paul Chiusano
1cf21b89f3
Merge pull request #1652 from unisonweb/topic/datadecl-cleanup
rename Data/EffectDeclaration' to Data/EffectDeclaration
2020-08-15 14:12:58 -04:00
Jared Forsyth
b3b0db2f61 retain op I guess 2020-08-14 15:43:55 -05:00
Arya Irani
4a56dda1bc rename DataDeclaration' to DataDeclaration, etc. 2020-08-12 19:39:24 -04:00
Runar Bjarnason
ed621377c4 Merge branch 'trunk' of github.com:unisonweb/unison into topic/nohistoricsearch 2020-08-11 21:39:10 -04:00
Runar Bjarnason
4399d08efb Disable historic name search and allow hash lookup 2020-08-11 21:11:46 -04:00
Arya Irani
f68f7eb984 Merge branch 'topic/patternp' into wip/rt2 2020-08-10 11:50:53 -04:00
Arya Irani
a425ca299d deleted some old comments 2020-08-10 11:18:26 -04:00
Arya Irani
d0c2fed081 clean up PatternP vs Pattern 2020-08-10 10:59:17 -04:00
Ian Grant Jeffries
e4b0a8118e Touchup 2020-07-29 20:39:15 -04:00
Ian Grant Jeffries
7eb4645d23 Remove now redundant extensions 2020-07-29 20:30:03 -04:00
Ian Grant Jeffries
c098309594 Remove now redundant default-extensions
(TypeSynonymInstances is implied by FlexibleInstances)
2020-07-29 20:13:31 -04:00
Ian Grant Jeffries
fcc8f425e2 Standardize default-extensions throughout repo 2020-07-29 19:59:29 -04:00
Dan Doel
4162db7ef3 Add builtins for new IO functions
- The ability for this is a built in reference, rather than a declared
  definition, so it won't be possible to handle it without some
  additional work. The plan is for it not to be possible to handle it,
  though.
- Functions using the ability are directly implemented, rather than
  going through indirections.
2020-07-28 11:42:41 -04:00
Dan Doel
781361af1d Merge branch 'trunk' into wip/rt2, with fixes
- Fixed some problems with previous commits due to local build failure
2020-07-14 13:30:46 -04:00
Dan Doel
781108d925 Refinements of sequence pattern compilation
- It is still not completely correct, but dealing with the problem fully
  requires a modified approach with more lax 'matrices'.
2020-07-14 11:03:40 -04:00
Dan Doel
bac5ff1042 Eta expand constructors before floating 2020-06-18 16:44:53 -04:00
Dan Doel
77f7183afe Keep track of effect vs. data in pattern compilation
- We need to rebuild the right patterns, and effect declarations
  don't actually have the 'pure' case in them (which is uniform
  across all effects), so they need slightly different handling.
- Also duplicate a bit more 'builtin' logic to avoid threading
  around Either values where only one branch makes sense in any
  situation
2020-06-18 12:25:28 -04:00
Dan Doel
57dfc4f1d3 Don't try to determine field references from constructor type
- It doesn't work very well with the data declaration information
  that is tracked by unison
- Also include a previously uncommitted change from data declarations,
  which now gives the number of fields that a constructor has (this is
  the only information the pattern compiler now relies on; previously
  it was assuming the Reference for the type of each field could be
  determined from the DataDecl).
2020-06-17 15:59:21 -04:00
Arya Irani
3419d7c4ab
Merge pull request #1600 from unisonweb/mitchell/haddock-fixes
Make haddock-like comments not valid haddocks
2020-06-07 09:22:57 -04:00
Mitchell Rosen
8b2cb7700d Add Unison.Util.PinBoard 2020-06-03 20:10:06 -04:00
Mitchell Rosen
5a0772b515 Make haddock happy 2020-06-02 22:09:17 -04:00
Dan Doel
edce1f8d1e Make it possible to show ANF code 2020-06-01 16:45:10 -04:00
Arya Irani
d62e81cb54
Merge branch 'master' into mitchell/lts-15.13 2020-05-31 10:20:28 -04:00
Dan Doel
732d1d3cb8 Merge branch 'master' into wip/rt2, with fixes 2020-05-29 13:11:33 -04:00
Runar Bjarnason
f8ca007272 Repair suffixes. Tests passing. 2020-05-28 22:54:08 -04:00
Runar Bjarnason
361f89e9d7 Excise uses of Text.splitOn 2020-05-28 22:31:29 -04:00
Runar Bjarnason
d066190f8e NameSegment and Name fiffing 2020-05-28 21:53:50 -04:00
Dan Doel
d904824bbc Create interface to new runtime system
- Created a function for extracting references from LabeledDependency
  with an indication of whether it's a term or type reference
- Use a custom runtime exception type in the new runtime instead of
  erroring
- Create a new entry point to the runtime that applies a combinator
  * This function returns a closure result for watch expression use
- Use the pretty error type for decompile errors
- Names and backreferences for bultins
- Current runtime interface expects no actual referenced terms (just
  one large letrec). Some steps are in place for changing this, though.
2020-05-28 18:06:18 -04:00
Runar Bjarnason
f57d208311 wip 2020-05-28 15:02:33 -04:00
Runar Bjarnason
ba271dc42a Allow the last segment of a name to be . 2020-05-28 13:45:58 -04:00
Paul Chiusano
745b17e494 Merge remote-tracking branch 'origin/master' into topic/abilities-fixes 2020-05-27 22:56:23 -04:00
Mitchell Rosen
3f4e8a450a Bump to lts-15.13 2020-05-24 10:20:52 -04:00
Arya Irani
0ad2b865e7 remove junk 2020-05-12 17:58:37 -04:00
Arya Irani
68999e6b2e compiles but fails tests 2020-05-11 13:56:33 -04:00
Paul Chiusano
bff925ef0e New version of existentializeArrows that uses different variable generator for positive and negative position 2020-05-07 08:08:20 -04:00
Runar Bjarnason
6d8b9ed62d More readable patterns 2020-04-30 16:06:21 -04:00
Runar Bjarnason
88b3de61ac 1. Make history search honor seen list.
2. Fix labeled dependencies for term links
2020-04-30 15:05:18 -04:00
Dan Doel
4c3e52c2be Improve show instance for ABT
- Use precedence in Var case.
2020-04-17 15:47:40 -04:00
Dan Doel
abe17a5b20 Introduce pattern compilation machinery.
- Turns match statements with nested patterns and
  guards into statements that only match on a single
  layer of a type, and do not use guards.
2020-04-15 11:06:42 -04:00
Chris Gibbs
8dfc25e68d Merge branch 'master' into topic/1363-doc-space-glitch 2020-04-13 16:07:21 +01:00
Arya Irani
85700b338a Merge remote-tracking branch 'origin/topic/dependents-dependencies-debug.file' into topic/dependents-dependencies-and-debug.file 2020-04-03 23:35:25 -04:00
Arya Irani
d64a231988 implement dependents <x>, dependencies <x>, and debug.file 2020-04-03 21:50:24 -04:00
Arya Irani
766f2403db implement dependents <x>, dependencies <x>, and debug.file 2020-04-03 21:21:02 -04:00
Paul Chiusano
7a6b411e97 Ensure fresh var isn't old either
Not positive this is needed, but also not positive it isn't needed, and not harmful to do
2020-04-02 23:05:58 -04:00
Paul Chiusano
a0fb28c1a5 Fix #1277 and add unit test
Also reverted incorrect ABT Eq instance. Need to rename both Abs to bring the names into alignment
2020-04-02 22:48:42 -04:00
Paul Chiusano
3c396c5d92 Fix #1388
After fixing this, some serialization round trip tests started failing. This ended up being due to the Eq instance for ABT being busted due to its use of rename, which has a subtle variable capture bug that @dolio spotted a while ago https://github.com/unisonweb/unison/issues/1277 #1277 needs a proper fix but in the meantime, I've tweaked the Eq instance to be a bit more efficient and also avoid the #1277 bug in this particular case.
2020-03-31 19:06:18 -04:00
Arya Irani
a555c854eb added a 3rd FileCodebase sync algorithm;
split out the three algorithms into three files, because too big file.
could probably stand to factor out commonalities.
2020-03-31 09:42:42 -04:00
Dan Doel
1933409b28 Implement a true lambda lifting pass on Terms
- First closes all lambdas with respect to free variables
- Second lifts all lambdas and let(rec)s to a single
  top-level binding group.
2020-03-27 17:20:09 -04:00
Arya Irani
bf59f60076
Merge pull request #1372 from pete-ts/fix/1339
Removes empty string at the end of Name.suffixes output and unittests
2020-03-22 17:32:58 -04:00
Arya Irani
2caf56a86c remove all trailing whitespace 2020-03-22 15:39:50 -04:00
Arya Irani
35fbe86fe9
Merge pull request #1378 from unisonweb/topic/reference.id
Let more places use Reference.Id
2020-03-21 08:05:10 -04:00
Arya Irani
3a16b33b7a Let more places use Reference.Id where appropriate
- Codebase functions are now parameterized by Reference.Id or Referent.Id
  (a Referent that doesn't refer to a built-in) where appropriate, to
  enforce at the type level that Codebases can't contain builtins, and
  to eliminate jank that was enforcing or assuming this at runtime.

  ditto CodeLookup

  ditto `UnisonFile` and `TypecheckedUnisonFile`; with some backwards-
  compatible functions and pattern synonyms to support the old types,
  and some new functions for the new types.

- Codebase.getRootBranch and .getBranchForHash return a sum type instead
  of a magic value (`Branch.empty`) on error. `BranchLoadMode` goes away.

  `getRootBranch`'s result distinguishes between "I don't know what the
  head is supposed to be" vs "I do know what it is supposed to be but
  couldn't find it".

- Not strictly related to Referent.Id (oops) but I moved the actual
  builtin Decls from `unison-core/Unison.DataDeclaration` to
  `unison-parser-typechecker/Unison.Builtin.Decls`.

  I left these qualified as `DD` to minimize diffs, although it may
  make it harder to know which module a `DD.` definition is coming from.
2020-03-20 18:47:30 -04:00
Runar Bjarnason
8f0da4d4a6 Improved types in Input per Arya 2020-03-19 17:56:20 -04:00
pete-ts
52965d2ddf suffixes no longer adds "" at the end of the list 2020-03-19 20:05:14 +00:00
Paul Chiusano
083ed75f3e Metadata display in BranchDiff now uses HashQualified rather than HashQualified'. 2020-03-18 21:56:02 -04:00
Paul Chiusano
060dc59cc2 Mostly fixed, but unlink seems to be deleting all the definitions, not just the selected one.
- Revamped LinkI and UnlinkI - the md value is a HashQualified, so you can unlink by hash only now
- Support unnamed metadata in the diff display
- Remove HQ'.unsafeFromHQ, which was used in one place and was causing a crash
- Better output messages for various link/unlink failures
2020-03-18 12:27:50 -04:00
Chris Gibbs
991e266267 Part of a fix for #1363 - preservation of spaces after @ directives in first line when unindenting
Still need to dig into impact on docs.output.md.
2020-03-16 23:06:17 +00:00
Paul Chiusano
57e14ee3f7 Removed all but one calls to fromJust and added failing transcript 2020-03-13 17:05:48 -04:00
Dan Doel
0cfe36893d Restructured ANF in view of ability compilation
- ANF handle construct takes direct branching, and corresponds to
  surface syntax matching on `Request`. This is the location where
  we know which abilities are in play and can install handlers
  without complicated information passing.
- The ANF handle is distinct from other case analysis because the
  scrutinee need not already be evaluated. One could conceive of
  this as being call-by-name case analysis rather than call-by-value,
  although that is not how it will be implemented.
- This means that a function that does Request matching essentially
  needs to have a call-by-name argument, and the surface-level handle
  construct is a form of call-by-name application. Therefore, it
  compiles into a by-name correspondent to let.
- However, this also probably means that Request and handle are
  inessential in the surface syntax. `Request {e} a` is essentially
  the same as `'{e} a`, handle quotes its body, and ability matching
  forces the suspended computation. If the type checker were modified
  such that matching could provide abilities to its scrutinee, this
  scheme would work with quote and !.
2020-03-12 12:34:16 -04:00
Arya Irani
9a362f7101 supporting hashes in alias; and names and builtins in replace
Exploded Codebase.referencesByPrefix into three functions:

- referencesByPrefix :: Text -> m (Set Reference.Id)
+ termReferencesByPrefix :: ShortHash -> m (Set Reference.Id)
+ typeReferencesByPrefix :: ShortHash -> m (Set Reference.Id)
+ termReferentsByPrefix :: ShortHash -> m (Set (Referent' Reference.Id))

for top-level terms, top-level types, and for Ref/Con mix.
They only return "derived" references, the thinking is that builtins will
come from a higher level api.

Exploded Command.ReferencesByShortHash into three functions
- ReferencesByShortHash :: ShortHash -> Command m i v (Set Reference.Id)
+ TypeReferencesByShortHash :: ShortHash -> Command m i v (Set Reference)
+ TermReferencesByShortHash :: ShortHash -> Command m i v (Set Reference)
+ TermReferentsByShortHash :: ShortHash -> Command m i v (Set Referent)

I actually don't remember why it was ok that it was Reference.Id before
but isn't now.  Maybe we hadn't wanted to auto-complete Builtin names?
I don't remember.

controversial?
* Added a type arg `r` to `Referent`; type alias and patterns for compat.
* Deleted BranchUtil.getTermByShortHash because I'm guessing we no longer
  want to limit such searches to the branch?  Uncertain.
* Reference.fromShortHash rejects inputs with ctorIds in them; seemed
  better than ignoring them, but I could imagine there being a case for
  each.
2020-03-10 13:00:00 -04:00
Dan Doel
01e6ca3fea Restructure normalized ABT and ANF code slightly
- Moved variable occurrences out of the ABT structure. Since the
  variable type gets passed directly to the shape functor, it's not
  necessary for the ABT to handle variable occurences, and the
  factorization was interfering with the structure of the algorithm.
- Made the ABT and Term types directly recursive. There doesn't seem to
  be a reason for them not to be
- Factored the ANF shape functor into two types to ensure that there is
  no let binding with a let directly inside it. Instead lets must be
  linearized. This is arguably more normalized, and should correspond
  closer to CPS.
2020-03-05 16:51:35 -05:00
Dan Doel
4e11e2cd32 Merge branch 'master' into wip/rt2 2020-03-03 16:07:27 -05:00
Dan Doel
60516504e8 Implement new ANF transformation
- Uses a new, explicitly normalized representation of terms.
- Also assumes that the terms have already been compiled to
  supercombinators, as there is no representation of local
  lambdas or letrec.
2020-03-03 15:01:13 -05:00
Arya Irani
7dd59bc78c rename AnnotatedTerm to Term 2020-03-03 18:43:51 +01:00
Dan Doel
f7f8a1db65 Start building an ABT for normalized trees 2020-02-27 13:21:46 -05:00
Paul Chiusano
652ae4ac76
Merge pull request #1192 from anovstrup/topic/handle-with-lambdacase
Lambda-case `cases` syntax
2020-02-20 11:35:21 -05:00
Aaron Novstrup
5949e7e81b pretty-print cases expressions outside of let bindings; add tests for cases parsing / pretty-printing 2020-02-17 15:57:24 -08:00
Aaron Novstrup
87757fb305 pretty-print lambda-case in let bindings 2020-02-15 14:33:22 -08:00
Arya Irani
e60971675c minor cleanup 2020-02-14 16:58:36 -05:00
Arya Irani
abfe928f61 replace auto-derived Ord HQ instance which had ordered z before a#x
new Ord HQ instance does order `#x` before `a#x`, though.
2020-02-11 20:51:55 -05:00
Arya Irani
72832815eb updated MergeLocalBranchI to use two updates, and not print todo
implement added Lens.Cons and Lens.Snoc instances (closes #1200):

instance Cons Path Path NameSegment NameSegment
instance Snoc Relative Relative NameSegment NameSegment
instance Snoc Absolute Absolute NameSegment NameSegment
instance Snoc Path Path NameSegment NameSegment
instance Snoc Path' Path' NameSegment NameSegment

and class Path.Resolve l r where
  resolve :: l -> r -> l
with
instance Resolve Path Path
instance Resolve Relative Relative
instance Resolve Absolute Relative
instance Resolve Path' Path'
instance Resolve Path' Split'
instance Resolve Absolute Path'
2020-02-06 00:05:34 -05:00
Chris Gibbs
30516d73d4 Code review markup from #994
Move helper function to Unison.Util.List.intercalateMapWith.  Tested to check it's not actually restricted to even-length inputs.
2020-01-20 23:03:10 +00:00
Paul Chiusano
b3b43e193d Merge remote-tracking branch 'origin/master' into diff.namespace
# Conflicts:
#	parser-typechecker/src/Unison/Util/Pretty.hs
2020-01-17 15:07:58 -05:00
Chris Gibbs
52ef0681d2 Merge branch 'master' into topic/docs-936-pretty-literals 2020-01-16 22:56:33 +00:00
Arya Irani
c8136c02dd fix hq bracket alignment and hide some blank lines 2020-01-16 16:39:41 -05:00
Arya Irani
8f66210115 split updatedTerms into updatedTerms, newTermConflicts, resolvedTermConflicts 2020-01-16 12:26:33 -05:00
Arya Irani
f1a6f16fe1 switch tallnamespaceUpdates representation & trying to fix bugs 2020-01-14 17:13:52 -05:00
Arya Irani
5c5cf6b65a use BranchDiff.allNameChanges to compute adds, removes, and renames 2020-01-10 13:40:58 -05:00
Paul Chiusano
4bcd58ecef fleshed out transcript some more, fixed a number of bugs 2020-01-08 16:32:18 -05:00
Paul Chiusano
3adbc476e3 Merge remote-tracking branch 'origin/master' into diff.namespace
# Conflicts:
#	parser-typechecker/src/Unison/Codebase/Branch.hs
#	parser-typechecker/src/Unison/Codebase/Editor/HandleCommand.hs
#	parser-typechecker/src/Unison/Codebase/Editor/Output.hs
#	parser-typechecker/src/Unison/Codebase/TranscriptParser.hs
#	parser-typechecker/src/Unison/CommandLine/Main.hs
#	parser-typechecker/src/Unison/CommandLine/OutputMessages.hs
2020-01-08 12:00:38 -05:00
Mitchell Rosen
09afe1e1f0 Show aliases when searching by type 2020-01-04 21:16:15 -05:00
Arya Irani
1a4533af99 prettyUpdate{Type,Term} 2019-12-23 16:59:39 -05:00
Chris Gibbs
f1cb1c943e Merge branch 'master' into topic/docs-936-pretty-literals 2019-12-21 22:09:12 +00:00
Arya Irani
02153976ea fleshed out HandleInput.DiffNamespaceI 2019-12-19 16:46:06 -05:00
Arya Irani
d839766831 Output.branchDiff.toOutput.updatedTypes 2019-12-19 14:31:59 -05:00
Arya Irani
0b95e69941 deprecate Names2.hq{Term,Type}Name...
...because they didn't use a codebase-wide notion of hqlen
2019-12-19 12:18:00 -05:00
Arya Irani
aee88cad25 I left some "undefined"s in Output.BranchDiff.toOutput 2019-12-18 17:28:53 -05:00
Arya Irani
c039a51f8c rejiggered Codebase.BranchDiff 2019-12-18 15:07:32 -05:00
Arya Irani
516c5e3771 Switch BranchDiff.metadata to Relation3 2019-12-17 19:19:16 -05:00
Arya Irani
337fb2154e redesigning and fleshing out Output.BranchDiff.toOutput 2019-12-17 18:00:25 -05:00
Arya Irani
e1e8a5937b Merge branch 'master' into diff.namespace 2019-12-16 14:45:45 -05:00
Arya Irani
ae23874712 split up deepTerms/deepTermMetadata
diff0 still todo
2019-12-16 14:26:04 -05:00
Mitchell Rosen
6e554823ef Move Unison.Codebase.NameSegment to unison-core 2019-12-15 11:38:02 -05:00
Mitchell Rosen
764b2f4ae8 Show term/type hashes (for adds/removes) in diff output, if ambiguous 2019-12-15 09:13:48 -05:00
Mitchell Rosen
24adf5060a Make Name an abstract type 2019-12-14 14:02:58 -05:00
Arya Irani
c442523c11 building cleanly, but one test is failing due to undefinedsomewhere 2019-12-13 19:13:19 -05:00
Arya Irani
227c103fe0 Refactored deep{Terms,Types} into Relation4 & started refactoring HandleInput.getLinks 2019-12-13 17:25:23 -05:00
Paul Chiusano
7814fd4b78 Merge remote-tracking branch 'origin/master' into fix/987
# Conflicts:
#	unison-src/transcripts/merges.output.md
#	unison-src/transcripts/reflog.output.md
2019-12-12 15:03:27 -05:00
Paul Chiusano
a10f540975 tweak to orderedComponents implementation 2019-12-11 14:07:08 -05:00
Chris Gibbs
81668b644a Merge branch 'master' into topic/docs-936-pretty-literals 2019-12-11 18:51:15 +00:00
Arya Irani
823a39c032 first pass at implementing from datalog 2019-12-10 13:28:34 -05:00
Tomas Mikula
705bb08a7f Merge branch 'master' into demote-TypeVar 2019-12-09 22:19:42 +01:00
Paul Chiusano
e46ceb8cee Merge remote-tracking branch 'origin/master' into fix/987 2019-12-09 14:46:38 -05:00
Arya Irani
68fa185a83 Merge remote-tracking branch 'origin/master' into diff.namespace 2019-12-09 09:17:53 -05:00
Mitchell Rosen
dbc1006eea Move Unison.Paths to unison-core 2019-12-08 23:07:06 -05:00
Mitchell Rosen
e38f3046c9 Move Unison.Codebase.SearchResult from unison-core to unison-parser-typechecker 2019-12-08 01:43:47 -05:00
Arya Irani
1bde90bd92 started implementing BranchDiff.toOutput 2019-12-06 16:14:40 -05:00
Paul Chiusano
172e8e7337 minimizeOrdered function 2019-12-05 23:43:07 -05:00
Arya Irani
fdbbc1d4f5 Merge branch 'master' into topic/bug991 2019-12-05 13:46:05 -05:00
Mitchell Rosen
83af25773b Carve out unison-core package 2019-12-04 18:57:26 -05:00