Commit Graph

4396 Commits

Author SHA1 Message Date
Runar Bjarnason
823cb434ba Tuple literals parse 2018-06-14 17:40:27 -04:00
Runar Bjarnason
046074d2ba As-patterns 2018-06-14 17:25:17 -04:00
Runar Bjarnason
910a70f3a9 More pattern type checking tests 2018-06-14 17:05:56 -04:00
Runar Bjarnason
5c1e4d6543 Plumbing to get typechecker tests working 2018-06-14 15:22:09 -04:00
Arya Irani
bfd05da1ba refactor towards adding typechecking tests having data declarations 2018-06-14 13:34:38 -04:00
Paul Chiusano
88d62e43c4 patterns now checked against scrutinee inferred type 2018-06-13 21:48:39 -04:00
Paul Chiusano
8d1e6c22f7 Typechecker working again with more general term type - existential vars are now allowed in type annotations 2018-06-13 21:38:25 -04:00
Paul Chiusano
64954ca8aa generalize a number of smart constructors to not assume type variables and term variables are the same type 2018-06-13 21:37:24 -04:00
Paul Chiusano
cebe6c637d another helper function - Term.vtmap, for mapping over the type variables of a term's annotations 2018-06-13 21:04:52 -04:00
Paul Chiusano
ecd1b72b85 generalized some ABT functions in prep for allowing existential and universal type vars to appear in type annotations on terms 2018-06-13 20:54:59 -04:00
Runar Bjarnason
cf7aa13102 Rewrote checkCase 2018-06-13 15:47:29 -04:00
Arya Irani
97562ff0a7 we are debugging typechecking of patterns 2018-06-13 14:24:49 -04:00
Arya Irani
efe34fd8d7 check for free type vars in data decls before typechecking, subst them away in bootstrap 2018-06-13 10:41:30 -04:00
Paul Chiusano
3b6630d1ab Removed defunct check logic for Match, just falling back to synthesis for now. Added synthesis case for Term.Constructor. 2018-06-12 22:59:06 -04:00
Arya Irani
e2557cfac4 remove Builtin.resolveBuiltins in favor of Term.bindBuiltins and Type.bindBuiltins
note: arguably more efficient to only `subst` away the free vars,
and maybe we should use `Map v (Term v)` in various places instead
2018-06-12 18:24:51 -04:00
Arya Irani
8dd5350e1f including that one 2018-06-12 17:41:14 -04:00
Arya Irani
59255f1393 Take builtin substitutions out of Unison.{Parsers, FileParser} 2018-06-12 17:38:27 -04:00
Arya Irani
92f43221d3 typechecking for pattern-matching (untested) 2018-06-12 17:01:00 -04:00
Paul Chiusano
2da9ace1d5 WIP on typechecking case expressions 2018-06-12 14:24:02 -04:00
Paul Chiusano
a2ddd994b4 fix parser bug where = in bindings was not required to be followed by a space 2018-06-12 11:33:07 -04:00
Paul Chiusano
4ff9a686e0 added todo to reshuffle module structure a bit 2018-06-12 11:23:57 -04:00
Paul Chiusano
f76fcec5a9 move anf to Term module 2018-06-11 23:06:51 -04:00
Paul Chiusano
616741d9c9 filled in more of compile 2018-06-11 22:58:02 -04:00
Paul Chiusano
29b551343e implemented ANF conversion 2018-06-11 22:45:48 -04:00
Arya Irani
5b601a4248 update codecs to use VarInt encoding for Text and Array lengths
Note that the max sizes for these on the JVM are <= 31 bits
2018-06-11 18:54:39 -04:00
Arya Irani
dcd15f8c73 use VarInt encoding for backrefs and sequence lengths 2018-06-11 18:19:22 -04:00
Paul Chiusano
deaecaacac finished filling in Apply compilation 2018-06-11 17:15:57 -04:00
Paul Chiusano
f5b4fe5fe8 added some convenience functions to ABT 2018-06-11 12:21:15 -04:00
Paul Chiusano
b2de0a3caf start on compilation 2018-06-11 12:20:37 -04:00
Paul Chiusano
d0f044350b draft of simple Haskell-based interpreter 2018-06-11 11:14:14 -04:00
Arya Irani
3fe58f25b1 weird 2018-06-10 16:11:47 -04:00
Arya Irani
e1e84bc9fa add more traced toward fixing new failing test 2018-06-10 16:06:24 -04:00
Arya Irani
c0839e6c27 add typechecking phase to bootstrap program 2018-06-10 16:04:56 -04:00
Arya Irani
39fdaf92d5 move parsers which depend on both Builtins and other parsers from Parsers to Parsers2 (name tbd) 2018-06-10 16:04:11 -04:00
Arya Irani
3e81af5601 clean up tests by temporarily enabling GHC warnings 2018-06-08 12:34:21 -04:00
Arya Irani
b6f4a38db6 Split UnisonFile data structure / non-parsing-related out of FileParser 2018-06-08 12:30:25 -04:00
Arya Irani
59acd4d5da test parsing and typechecking sequences let-expressions
refactor to eliminate a dependency loop between Unison.Builtins and Unison.Parsers
move `unsafe*Parse*` from `FileParser` to `Parsers`
add `builtinEnv` parameter to `FileParser.file`
make `let` a keyword, or else maybe parsing precedence needs to change to be unambiguous
2018-06-07 18:47:34 -04:00
Arya Irani
9cbbf58bdd Merge remote-tracking branch 'origin/topic/typechecker' into wip/typechecker2 2018-06-06 17:58:36 -04:00
Arya Irani
de47993345 Context.synthesize for if, and, or 2018-06-06 17:50:20 -04:00
Arya Irani
b075d58e26 typechecking for Text literals 2018-06-06 17:09:50 -04:00
Arya Irani
d2e85729ac split bootstrap into non-overlapping source tree
helps intellij plugin and reduces `.cabal` length
2018-06-06 14:27:41 -04:00
Arya Irani
b3c922df36 substed in Terms for user-defined Data and Effect constructors 2018-06-05 18:47:15 -04:00
Arya Irani
64ddd5d02d renamed some builtins, ran harder program; problem with local data decls 2018-06-05 18:02:04 -04:00
Arya Irani
41ba5c10c5 fixed true/false parsing 2018-06-05 17:49:49 -04:00
Arya Irani
25c52d169d 3++ == 4 2018-06-05 17:40:15 -04:00
Runar Bjarnason
e7d45eac41 Making progress substing builtins 2018-06-05 17:30:58 -04:00
Arya Irani
349030fb56 added text builtins in Haskell 2018-06-05 17:11:31 -04:00
Arya Irani
0937cef79c add some of the builtins 2018-06-05 17:05:14 -04:00
Arya Irani
0586babb25 fairly successful cross-platform serialize/deserialize
still need to subst away builtins on the haskell side
2018-06-05 16:50:26 -04:00
Arya Irani
d961ddf8a2 Incremento! 2018-06-05 12:59:36 -04:00
Arya Irani
596a6bf8a6 delete 2018-06-05 12:06:56 -04:00
Arya Irani
e7a38949f8 implement serializeFile :: UnisonVile v -> m () untested 2018-06-05 12:06:24 -04:00
Arya Irani
df91671f3b add the "more instructions" marker, most of the time 2018-06-05 10:58:27 -04:00
Paul Chiusano
3de9756900 filled in rest of serializeTerm 2018-06-04 18:15:10 -04:00
Paul Chiusano
89ed94257e finished filling in serializePattern 2018-06-04 18:01:23 -04:00
Rúnar Óli Bjarnason
3390382ae5 filled in most of term serialization 2018-06-04 17:33:07 -04:00
Arya Irani
bc2cc50069 started a file 2018-06-04 14:34:35 -04:00
Arya Irani
58302ae563 update parser to be able to use data/effect decls it encounters 2018-06-04 14:23:44 -04:00
Arya Irani
dcf6acb372 add canonicalization tests for data type hashing
also have the test suite take a scope prefix on the command-line
2018-06-04 12:27:22 -04:00
Arya Irani
2f52572c75 implemented hashing of effect types and added some better docs 2018-05-31 18:01:12 -04:00
Arya Irani
03febf45e7 implemented Accumulate Hash using cryptonite 2018-05-31 17:10:24 -04:00
Rúnar Óli Bjarnason
e39f83c6d8 Preparing for hashing data declarations 2018-05-31 15:35:35 -04:00
Arya Irani
68d2549480 initial pass at structural hashing of data declaration cycles 2018-05-30 18:08:38 -04:00
Paul Chiusano
7521201256 added some diagnostics 2018-05-29 17:23:05 -04:00
Paul Chiusano
80b30b7ec1 Convenience function for reading / parsing a whole file, also spotted needless attempt in effect pattern parser 2018-05-29 16:20:19 -04:00
Paul Chiusano
82453d1b8c tests all passing 2018-05-29 14:31:29 -04:00
Paul Chiusano
b01b6f1af6 switch to enable/disable tracing of parsing 2018-05-29 14:26:16 -04:00
Paul Chiusano
559daffe50 added effects to Type AST, trying to get everything parsing
There seems to be an issue with virtual semicolon parsing at end of file
2018-05-29 13:07:43 -04:00
Paul Chiusano
b77311dc8f uncommented some tests, still have to implement effect types and parser for these types 2018-05-24 17:33:11 -04:00
Paul Chiusano
75e227f3ae Fixed issue with virtual_rbrace not handling eof properly, data decl example passes 2018-05-24 17:28:28 -04:00
Arya Irani
8726f22012 trying to get FileParser working without breaking anything else
limited success
2018-05-24 16:46:19 -04:00
Arya Irani
4cd6f71b12 stubbed out FileParser 2018-05-24 13:35:30 -04:00
Arya Irani
532064f5cb Type annotations parser test 2018-05-24 11:15:27 -04:00
Rúnar Óli Bjarnason
14e90f9049 effect patterns for handlers working 2018-05-23 17:09:49 -04:00
Rúnar Óli Bjarnason
c1801ccf94 parse and 2018-05-23 16:11:03 -04:00
Rúnar Óli Bjarnason
63fe1eb329 Ifthenelse blocks and case blocks tests 2018-05-23 16:01:11 -04:00
Rúnar Óli Bjarnason
2234079b71 Fixed all warnings 2018-05-23 15:22:57 -04:00
Rúnar Óli Bjarnason
3b07bc54ae Added guards to the term language 2018-05-23 13:13:19 -04:00
Rúnar Óli Bjarnason
5db0940de6 Pattern rhs are blocks 2018-05-23 12:13:06 -04:00
Rúnar Óli Bjarnason
fb13e246fa I think it's that 2018-05-23 12:07:21 -04:00
Arya Irani
fee110dec2 data constructor pattern parsing compiles 2018-05-22 17:42:51 -04:00
Arya Irani
3e5c736ef5 thread penv0 through parsers 2018-05-22 17:12:28 -04:00
Arya Irani
8bcfc1dd3f add ABT.absChain and start on parsing of Patterns 2018-05-22 15:46:21 -04:00
Arya Irani
3c3ab7c868 add show implementation for handle term 2018-05-22 14:11:28 -04:00
Paul Chiusano
004926efd4 got some layout blocks working, still some lingering bugs 2018-05-22 13:02:45 -04:00
Paul Chiusano
f1583e8637 cleanup test 2018-05-21 17:32:53 -04:00
Paul Chiusano
bd86eb02e1 braced block tests passing, layout block test is failing 2018-05-21 17:31:43 -04:00
Rúnar Óli Bjarnason
40a24ff246 Braces and semicolons? 2018-05-21 16:06:49 -04:00
Rúnar Óli Bjarnason
aa3d7ff04c Parses blocks correctly 2018-05-21 13:25:00 -04:00
Paul Chiusano
e2c3a4a278 TermParsers.block compiling, also deleted some unused old parsers 2018-05-17 18:23:58 -04:00
Rúnar Óli Bjarnason
ba0c3de5dc Blocks? 2018-05-17 15:47:08 -04:00
Paul Chiusano
9214b63aca Updated the Type AST and did some refactoring - the parser now has no knowledge of the set of builtin functions and types 2018-05-17 13:01:01 -04:00
Paul Chiusano
0f32611d3a smart constructors 2018-05-17 12:04:23 -04:00
Paul Chiusano
d764fe0c85 Added a bunch of stuff to the term syntax tree, code still compiles 2018-05-17 12:01:38 -04:00
Paul Chiusano
59cdabf799 haskell code compiling again and tests passing, ready for merge 2018-05-16 23:13:58 -04:00
Paul Chiusano
42ea0604d2 started deleting and cleanup, not compiling yet 2018-05-16 18:20:27 -04:00