Paul Chiusano
df54b0defc
filled in decompile and more of compile, including lambdas (untested)
2018-08-24 14:09:27 -04:00
Paul Chiusano
0a3f8aa625
Merge branch 'wip/stanzas' into topic/haskell-runtime
...
# Conflicts:
# parser-typechecker/src/Unison/ABT.hs
# parser-typechecker/src/Unison/Term.hs
# parser-typechecker/unison-parser-typechecker.cabal
2018-08-24 10:46:16 -04:00
Paul Chiusano
fb44a09d53
a bit of cleanup of Lexer.tree error reporting
2018-08-23 22:52:29 -04:00
Paul Chiusano
60af643c1c
define debugLex in terms of Lexer.T show instance
2018-08-23 22:18:21 -04:00
Paul Chiusano
afb98b5354
Tests all passing, also converted a few tests to intermingle type/effect/use statements
2018-08-23 22:10:26 -04:00
Paul Chiusano
f123140346
Merge remote-tracking branch 'origin/master' into wip/stanzas
2018-08-23 21:52:11 -04:00
Paul Chiusano
02c1bac920
untested draft of lexer reordering
2018-08-23 20:34:44 -04:00
Rúnar Óli Bjarnason
16ca2932d0
Fixed console.uu
2018-08-23 14:56:50 -04:00
Arya Irani
f693f8cc5a
split TypeError extraction from printing; skeleton for regression tests
2018-08-23 10:23:17 -04:00
Paul Chiusano
eec237ba1e
fix Type.unTuple to not crash on tuple types with variables
2018-08-22 22:00:25 -04:00
Paul Chiusano
5b6231df5e
get rid of EffectPure and EffectBind from term AST
2018-08-22 21:17:28 -04:00
Paul Chiusano
bbfff95c17
fix issue in case checking where scrutineeType and outputType weren't being refined after each branch
2018-08-22 20:58:49 -04:00
Paul Chiusano
7beb1ed09c
wip on lexer improvements
2018-08-22 18:07:58 -04:00
Rúnar Óli Bjarnason
9fcc4f9bf0
everything compiling with new pattern checking but tests not passing in effect pattern inference
2018-08-22 15:51:09 -04:00
Rúnar Óli Bjarnason
2ff4404be3
Adding a marker to checkCase
2018-08-22 12:27:25 -04:00
Rúnar Óli Bjarnason
544fd5511b
Checking patterns
2018-08-22 12:25:01 -04:00
Rúnar Óli Bjarnason
426675a5a0
wip
2018-08-21 17:33:22 -04:00
Rúnar Óli Bjarnason
8c4539a999
Typechecking patterns directly instead of synthing
...
a fake term.
2018-08-21 17:18:58 -04:00
Arya Irani
20c5fce4b3
rearrange and flesh out Extractor slightly
2018-08-21 15:25:19 -04:00
Paul Chiusano
709f44e5b2
minor fixes as part of tracking down problem with console.uu
2018-08-21 14:15:37 -04:00
Arya Irani
73d7164278
add InSynthesizeApps
2018-08-20 16:36:53 -04:00
Arya Irani
e448532a2b
pretty error for unknown type
2018-08-20 14:09:00 -04:00
Arya Irani
41e82b9747
Merge remote-tracking branch 'origin/master' into wip/pretty-errors
2018-08-20 13:21:43 -04:00
Paul Chiusano
bc507a748e
fix issue where continuation in handler was not being appropriately constrained
2018-08-20 12:21:33 -04:00
Arya Irani
45acb0fbc6
wip - pretty errors for ill-typed function applications
2018-08-19 22:52:44 -04:00
Arya Irani
726f11b6f1
partial improvement of parse error messages
2018-08-19 12:32:32 -04:00
Arya Irani
a4bab5f392
Set all the elements of Builtins' annotations to Intrinsic
2018-08-19 12:31:24 -04:00
Arya Irani
5a21c76ad7
pretty error for when applying args to something that isn't a function
2018-08-18 19:42:02 -04:00
Paul Chiusano
c00f4e51e5
Merge pull request #233 from unisonweb/topic/pretty-errors
...
one round of errors improvement
2018-08-18 08:07:44 -04:00
Arya Irani
202ce84251
render typechecker context with hash substitution
...
Γ
|start|
'start
|let-rec-marker66|
state5 : s -> Effect (State s) a -> a
'y73
'e74 = State UInt64
'i75 = Text
'a76 = Text
's77 = UInt64
vs
Γ
|start|
'start
|let-rec-marker66|
state5 : (a. (s. s -> Effect (#32xTLAhY s) a -> a))
'y73
'e74 = #32xTLAhY UInt64
'i75 = Text
'a76 = Text
's77 = UInt64
2018-08-17 23:10:34 -04:00
Arya Irani
da9d46001b
minor cleanup
2018-08-17 22:30:00 -04:00
Runar Bjarnason
b23f166769
Actually fail when TDNR has suggestions.
2018-08-17 22:21:51 -04:00
Runar Bjarnason
8561295191
We don't need monad-morph after all
2018-08-17 21:15:21 -04:00
Runar Bjarnason
f0bd066c16
cleanup
2018-08-17 21:11:39 -04:00
Runar Bjarnason
4b2d8e89de
OK, TDNR working correctly this time
2018-08-17 21:08:09 -04:00
Arya Irani
d85de446b6
improved error for mismatched case body types
2018-08-17 18:54:28 -04:00
Runar Bjarnason
501d940b99
Maybe this solves TDNR bugs
2018-08-17 18:26:15 -04:00
Arya Irani
a66ed121f7
pretty errors for ill-typed pattern guard
2018-08-17 18:14:36 -04:00
Arya Irani
b8d7cca267
pretty errors for vector element mismatch
2018-08-17 17:41:37 -04:00
Arya Irani
84f059dd3d
render Sequence a
as [a]
2018-08-17 16:45:30 -04:00
Runar Bjarnason
8b900db65d
Wip wip
2018-08-17 16:43:55 -04:00
Arya Irani
59f24188f6
if/and/or-related type errors should be working now
...
code looking a bit less ugly too.
2018-08-17 16:39:33 -04:00
Arya Irani
b56b8b1dc3
fix false positive on or
errors
...
still need to update for cond/and, and start using (<|>)
2018-08-17 16:14:07 -04:00
Runar Bjarnason
b3e9f23194
Fuller API for Result monad
2018-08-17 15:45:56 -04:00
Arya Irani
1c682f55b5
sketched out cases for ExistentialMismatch (if/vector/case)*
...
* the checks yield false positives, see https://app.asana.com/0/781300632285932/783413200023835/f
- factored out "fromOverHere" to do a right thing for 0, 1, 2 other locations
- still haven't found a great model for extractors, but fixing the above bug may lead to something.
2018-08-17 14:32:58 -04:00
Arya Irani
b1bba8f8cc
sharing code for if/and/or; split if-typchecking into two steps
2018-08-17 10:48:10 -04:00
Arya Irani
6020ff2a72
added and- and or- specific type errors, but somehow broke Blockquote coloring?
2018-08-16 23:18:15 -04:00
Arya Irani
5ee2ab20a9
Merge branch 'master' into topic/pretty-errors
...
# Conflicts:
# parser-typechecker/src/Unison/PrintError.hs
2018-08-16 19:00:53 -04:00
Arya Irani
bfffd2f52d
add ex1.u discussion of recursive/interactive type errors
...
also remove columns and "colored"
2018-08-16 17:45:50 -04:00
Runar Bjarnason
28ec096a4e
Kill the computer
2018-08-16 12:42:38 -04:00
Arya Irani
8f94c4bb27
render hash types in unknown term message
2018-08-16 10:48:41 -04:00
Runar Bjarnason
e351635722
Merge branch 'master' into topic/tdnr2
2018-08-16 10:42:26 -04:00
Runar Bjarnason
955f525703
Type-directed name resolution, phase 2
2018-08-15 16:40:13 -04:00
Runar Bjarnason
f3f9dd2b9a
Wip with TDNR figuring out foo x y = x + 1 + y + 2
2018-08-14 22:03:20 -04:00
Runar Bjarnason
15a526b894
wip with writer monad
2018-08-14 21:13:07 -04:00
Runar Bjarnason
9f5135a97d
Actually look up types of references
2018-08-14 20:02:11 -04:00
Arya Irani
5590f5238a
add type signatures to tests to eliminate repl warnings
2018-08-14 16:39:42 -04:00
Paul Chiusano
5af38fb39b
Merge branch 'master' into wip/effects
...
# Conflicts:
# parser-typechecker/src/Unison/PrintError.hs
# parser-typechecker/src/Unison/Typechecker/Context.hs
# parser-typechecker/tests/Unison/Test/Typechecker.hs
2018-08-14 16:13:50 -04:00
Paul Chiusano
53a726c8a8
remove debugging statements
2018-08-14 12:58:08 -04:00
Paul Chiusano
1751383915
Revert "further simplified ability check"
...
This reverts commit bdd6097286
.
2018-08-14 12:54:43 -04:00
Runar Bjarnason
4f5f0ed1be
TDNR actually does work. Phase 1. Phase 2 is fixpoint.
2018-08-14 10:47:37 -04:00
Paul Chiusano
012d1b6de8
added inference of multiple effects
2018-08-13 22:41:01 -04:00
Paul Chiusano
bdd6097286
further simplified ability check
2018-08-13 22:27:04 -04:00
Paul Chiusano
55b5c608ce
simplifying ability check
2018-08-13 22:18:01 -04:00
Paul Chiusano
773d4a421e
tests passing
2018-08-13 22:12:43 -04:00
Paul Chiusano
50d1f385a2
all but one test passing
2018-08-13 20:04:21 -04:00
Runar Bjarnason
b938e1f530
Remove notes that we're handling in tdnr
2018-08-13 19:56:27 -04:00
Paul Chiusano
ac55ce1dc6
possibly more progress
2018-08-13 18:30:37 -04:00
Paul Chiusano
7ffb9c3ce7
more progress
2018-08-13 18:22:33 -04:00
Paul Chiusano
f8d48205f6
allowing effect variables in type signatures to be instantiated to multiple effects
2018-08-13 16:32:02 -04:00
Runar Bjarnason
7c55d507b7
TDNR seems to work!
2018-08-13 14:18:12 -04:00
Runar Bjarnason
03f2beb6aa
Merge branch 'topic/pretty-errors' of github.com:unisonweb/unison into topic/type-directed
2018-08-13 14:13:56 -04:00
Paul Chiusano
c87997e482
tests all pass
2018-08-13 12:38:53 -04:00
Arya Irani
f3e3e60b1e
debugging hidden highlighting
2018-08-13 12:25:34 -04:00
Arya Irani
7d843f1660
minor cleanup
2018-08-13 12:25:16 -04:00
Paul Chiusano
c29742a958
simplify synthesizeApp
2018-08-13 10:51:44 -04:00
Paul Chiusano
289781827f
diagnostics
2018-08-11 14:43:41 -04:00
Paul Chiusano
93e701365d
withAbilityCheckFor is a bit more sophisticated now - it removes from ambient any effect it will shadow
2018-08-11 01:00:10 -04:00
Paul Chiusano
b9923b3be9
huzzah
2018-08-11 00:41:01 -04:00
Paul Chiusano
46c6fac08c
woot
2018-08-11 00:17:17 -04:00
Paul Chiusano
227a545214
simple test for effect inference
2018-08-11 00:15:22 -04:00
Paul Chiusano
165123514d
withoutAbilityChecksFor now correctly chains
2018-08-10 23:50:34 -04:00
Runar Bjarnason
4721d06c28
Merge branch 'topic/pretty-errors' of github.com:unisonweb/unison into topic/type-directed
2018-08-10 16:11:24 -04:00
Arya Irani
5bb74984b7
Unison.Test.Typechecker now renders error messages on failure
2018-08-10 16:01:05 -04:00
Runar Bjarnason
47b8e5c7d3
Merge branch 'topic/typechecker-test2' of github.com:unisonweb/unison into topic/type-directed
2018-08-10 14:25:21 -04:00
Paul Chiusano
9e3148937b
all but one test passing, something with handle inference
2018-08-10 13:12:12 -04:00
Paul Chiusano
713fbe8396
Merge remote-tracking branch 'origin/topic/pretty-errors' into wip/effects
2018-08-10 11:25:29 -04:00
Paul Chiusano
528976e9cc
simplify subtype, add effect inference, still debugging a couple failing tests
2018-08-10 11:25:13 -04:00
Arya Irani
0e302bb040
rename Unison.Test.Typechecker2 to Typechecker
2018-08-09 16:09:46 -04:00
Arya Irani
a5f9c9729d
moved the last of the tests from Unison.Test.Typechecker into individual files
2018-08-09 16:08:51 -04:00
Runar Bjarnason
f7bd352b2f
TDNR while synthing a file
2018-08-09 15:39:18 -04:00
Arya Irani
69106535d0
misc fixes:
...
- can call bootstrap without output file if no output file is desired
- look up References when rendering the file body type printed by bootstrap
- generalize PrintError.{renderType,renderType',renderKind,showRef'}
- add original note to AbilityCheckFailure for debugging
2018-08-09 15:33:46 -04:00
Runar Bjarnason
f9287ed216
Synth and resolve
2018-08-09 15:02:20 -04:00
Runar Bjarnason
9ac1901d61
remove stray typew
2018-08-09 14:37:37 -04:00
Runar Bjarnason
d2a7745a90
I think that solves TDNR
2018-08-09 14:36:49 -04:00
Paul Chiusano
f2abb2af53
tests pass
2018-08-09 09:06:56 -04:00
Paul Chiusano
fd43238e80
redo instantiateL/R
2018-08-09 08:47:22 -04:00
Paul Chiusano
693578e87c
effect inference wip
2018-08-09 08:30:08 -04:00
Runar Bjarnason
7900702347
well, it typechecks.
2018-08-08 21:28:03 -04:00
Paul Chiusano
3ac74f3db0
in progress on effect inference
2018-08-07 17:10:52 -04:00
Paul Chiusano
84ea1fc232
tests passing after refactoring
2018-08-07 13:26:29 -04:00
Arya Irani
2fd89ae6ee
moved a couple typechecker tests to .u files
2018-08-07 13:25:05 -04:00
Arya Irani
680b418073
some lovely cleanup in PrintError
2018-08-07 13:22:59 -04:00
Paul Chiusano
c8855b42a8
wip
2018-08-07 11:42:32 -04:00
Paul Chiusano
6b03258508
fix tests, make map/traverse test pending
2018-08-06 22:09:05 -04:00
Paul Chiusano
51470c980f
fix a test that was previously pending
2018-08-06 21:22:06 -04:00
Paul Chiusano
2159030820
Merge pull request #224 from unisonweb/topic/typechecker-test2
...
typechecker tests from files on disk
2018-08-06 21:14:06 -04:00
Paul Chiusano
1ce7420724
fix issue with let rec checking/inference
...
previously, we were inferring a completely incorrect type for bindings with a user-provided annotation
2018-08-06 21:12:42 -04:00
Arya Irani
ee644e79a0
Unison.Test.Typechecker2 typechecks unison files from unison-src/{tests,errors}
2018-08-06 19:47:09 -04:00
Paul Chiusano
949eb25280
uncomment logContext and fix instances for debugging
2018-08-06 18:32:52 -04:00
Paul Chiusano
307225677e
Merge remote-tracking branch 'origin/topic/pretty-errors' into fix/effects
...
# Conflicts:
# parser-typechecker/src/Unison/PrintError.hs
2018-08-06 18:09:28 -04:00
Arya Irani
7aee925a83
add unison-src/errors/X-array.u
program which passes typechecking when it shouldn't
2018-08-06 17:51:43 -04:00
Arya Irani
2506bf12ce
add note debug summary to type mismatch error
2018-08-06 17:50:48 -04:00
Arya Irani
cb0d2efbe7
fix bug describing Type1/Type2; break up type mismatch message
2018-08-06 17:49:54 -04:00
Arya Irani
163da591ff
simplify calls to PrintError.renderType
2018-08-06 16:11:29 -04:00
Runar Bjarnason
54789edc46
Keep unqualified names in env
2018-08-06 13:55:51 -04:00
Paul Chiusano
ad24ecac1f
Merge remote-tracking branch 'origin/topic/pretty-errors' into fix/effects
2018-08-06 13:26:44 -04:00
Arya Irani
6dc37b45fa
render types in ability check failure error
2018-08-06 13:26:32 -04:00
Paul Chiusano
097f130036
Merge remote-tracking branch 'origin/topic/pretty-errors' into fix/effects
2018-08-06 13:21:20 -04:00
Arya Irani
6a5263941d
resolve References to names in error printout?
2018-08-06 13:17:29 -04:00
Paul Chiusano
a4b17f0a0e
fix typechecking of EffectBind
2018-08-06 13:14:32 -04:00
Arya Irani
2d4ef88d4a
Merge remote-tracking branch 'origin/fix/effects' into topic/pretty-errors
2018-08-06 13:12:45 -04:00
Arya Irani
5fe4f6b5c9
render errors with 6 lines of separation before dropping lines from excerpt
2018-08-06 12:18:52 -04:00
Paul Chiusano
9f86399e70
fail gracefully in EffectBind checking rather than crashing the compiler
2018-08-06 12:18:30 -04:00
Paul Chiusano
2bbd9453ac
substitute the context before printing type errors
2018-08-06 09:59:54 -04:00
Paul Chiusano
0076fb2bab
synthesizeApp should strip any effects from the function type
2018-08-05 23:55:31 -04:00
Paul Chiusano
bfbff8eec8
fix unArrows and add a simple test for it
2018-08-05 22:40:23 -04:00
Paul Chiusano
9f2a040c72
Merge remote-tracking branch 'origin/topic/pretty-errors' into topic/delay
2018-08-05 21:44:37 -04:00
Paul Chiusano
e93aa9822e
got rid of delay keyword! works to just make ' bind looser than keyword based blocks
...
so you can just write `spawn 'let <block>`
2018-08-05 08:59:18 -04:00
Arya Irani
0942f7ad9d
added more hopefully helpful typechecker output
2018-08-04 08:15:23 -04:00
Arya Irani
db7c8f74b5
more tweaking of message i've never seen displayed
2018-08-04 00:00:47 -04:00
Arya Irani
92dca8ca8c
tweaked message slightly
2018-08-03 23:54:49 -04:00
Arya Irani
1cc02f7f78
add some more basic output for previously unhandled type errors
2018-08-03 23:50:39 -04:00
Arya Irani
4cc8848270
stack's incremental recompilation failed me
2018-08-03 19:31:59 -04:00
Arya Irani
5a9afe4611
Eliminated the P.ShowErrorComponent instance and replaced with first cut of AnnotatedText stuff
2018-08-03 19:24:07 -04:00
Arya Irani
9495e9790b
(not compiling) filled in something for PrintError.prettyParseError
2018-08-03 18:40:40 -04:00
Arya Irani
d635dcf6b2
Merge branch 'topic/delay' of github.com:unisonweb/unison into topic/pretty-errors (noncompiling)
...
# Conflicts:
# parser-typechecker/src/Unison/PrintError.hs
2018-08-03 18:28:14 -04:00
Paul Chiusano
027539b36f
added really dumb ability check failure printer, was blocked on this, needs much improvement still
2018-08-03 16:57:26 -04:00
Paul Chiusano
8a357206c2
Merge remote-tracking branch 'origin/topic/pretty-errors' into topic/delay
2018-08-03 15:19:06 -04:00
Paul Chiusano
f20ad4dda6
fixed issue with handling of namespace / imports
2018-08-03 15:16:09 -04:00
Arya Irani
17b2f77c72
(non-compiling) holes for parser errors
2018-08-03 15:06:31 -04:00
Arya Irani
02ccef19b8
Merge branch 'topic/delay' of github.com:unisonweb/unison into topic/pretty-errors
...
# Conflicts:
# parser-typechecker/src/Unison/PrintError.hs
# parser-typechecker/src/Unison/Util/ColorText.hs
2018-08-03 13:54:30 -04:00
Arya Irani
e3e22ac7d6
force overalltypes and mismatchsite to be shown in type mismatch excerpts
...
moved the invisible ForceShow to be earlier in the Ord than the other colors, which will override it at the same location
2018-08-03 12:00:29 -04:00
Arya Irani
d402ecbc13
map Intrinsic over builtin types; make some tweaks to typemismatch error
2018-08-03 11:51:43 -04:00
Arya Irani
88086f6e3c
fix off-by-one highlight end issue
2018-08-03 10:43:08 -04:00
Paul Chiusano
aea87a6e07
simplify syntax
2018-08-03 03:50:54 -04:00
Paul Chiusano
a18b7ab7d0
import Foo.bar
now works, no need for import Foo.[bar]
2018-08-03 03:50:54 -04:00
Paul Chiusano
52bc19143e
imports, can appear at start of any block
...
import Monoid.[zero, +]
import Math.sqrt
2018-08-03 03:50:54 -04:00
Paul Chiusano
4f0f41ddac
Lexer wordyId no longer consumes the .
in foo.
followed by spaces or a delimiter like [
2018-08-03 03:50:54 -04:00
Paul Chiusano
ef8e5a7bf4
IT'S ALIVE
2018-08-03 03:50:54 -04:00