Commit Graph

335 Commits

Author SHA1 Message Date
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
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
Paul Chiusano
06a53f232a added some pending tests 2018-08-22 10:57:18 -04:00
Paul Chiusano
95214e66f1 simpler console.uu example 2018-08-21 14:16:35 -04:00
Arya Irani
73d7164278 add InSynthesizeApps 2018-08-20 16:36:53 -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
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
Paul Chiusano
f78bc60ca0
Merge pull request #232 from unisonweb/topic/tdnr
Fix bug in TDNR
2018-08-18 08:05:01 -04:00
Runar Bjarnason
b23f166769 Actually fail when TDNR has suggestions. 2018-08-17 22:21:51 -04:00
Arya Irani
d85de446b6 improved error for mismatched case body types 2018-08-17 18:54:28 -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
Paul Chiusano
3821ef658f added some verbiage about issue with console.uu 2018-08-17 13:07:14 -04:00
Paul Chiusano
a0f5facc74 resurrect old tictactoe.uu since it was a failing test case, needed to debug 2018-08-17 13:01:46 -04:00
Paul Chiusano
9e24f8b946 unsoundness isolated pending test 2018-08-17 12:42:03 -04:00
Arya Irani
40d7255d45 pending test of importing local definitions 2018-08-16 19:24:55 -04:00
Arya Irani
43a4cd04b4 tictactoe.uu update (thanks @atacratic!)
glad someone is paying attention ;-)
2018-08-16 19:19:29 -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
184065d87b add some pattern matching tests 2018-08-16 11:34:37 -04:00
Arya Irani
c579ad9345 add pending tictactoe.uu program 2018-08-16 11:32:01 -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
15a526b894 wip with writer monad 2018-08-14 21:13:07 -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
Runar Bjarnason
4f5f0ed1be TDNR actually does work. Phase 1. Phase 2 is fixpoint. 2018-08-14 10:47:37 -04:00
Paul Chiusano
60ae54c0b5 updating map reduce 2018-08-13 23:40:03 -04:00
Runar Bjarnason
b938e1f530 Remove notes that we're handling in tdnr 2018-08-13 19:56:27 -04:00
Runar Bjarnason
7c55d507b7 TDNR seems to work! 2018-08-13 14:18:12 -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
Paul Chiusano
713fbe8396 Merge remote-tracking branch 'origin/topic/pretty-errors' into wip/effects 2018-08-10 11:25:29 -04:00
Arya Irani
3b5217674f unison-src/errors/state3.uu currently typechecks, even though it uses but doesn't handle the effect-pure case 2018-08-09 16:19:01 -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
Arya Irani
5f8e093917 a couple more error examples 2018-08-08 23:20:38 -04:00
Arya Irani
90be707834 add a couple tests, and shuffled some others around. 2018-08-08 22:21:57 -04:00
Arya Irani
2fd89ae6ee moved a couple typechecker tests to .u files 2018-08-07 13:25:05 -04:00
Paul Chiusano
69e026ac55 update test files 2018-08-07 13:09:35 -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
Arya Irani
ee644e79a0 Unison.Test.Typechecker2 typechecks unison files from unison-src/{tests,errors} 2018-08-06 19:47:09 -04:00
Paul Chiusano
06f9c91525 simpler failing example 2018-08-06 18:23:17 -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
Paul Chiusano
2bbd9453ac substitute the context before printing type errors 2018-08-06 09:59:54 -04:00
Paul Chiusano
4697c27c8e forgot to add this to commit, updated test file for new syntax 2018-08-05 19:10:59 -04:00
Paul Chiusano
30dcb4ccd7 started on map-reduce example, hit a bunch of bugs along the way 2018-08-03 18:47:12 -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
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
52bc19143e imports, can appear at start of any block
import Monoid.[zero, +]
import Math.sqrt
2018-08-03 03:50:54 -04:00
Arya Irani
28b4af17ff move bootstrap.sh and test.sh to scripts/ and add watch.sh also 2018-08-03 03:50:54 -04:00
Arya Irani
21e01fecf8 move bootstrap.sh and test.sh to scripts/ and add watch.sh also 2018-08-02 16:45:54 -04:00
Paul Chiusano
545f1c08c0 Merge remote-tracking branch 'origin/topic/pretty-errors' into topic/delay 2018-08-01 23:17:36 -04:00
Paul Chiusano
2dc12661dd Added syntax sugar: 'x for () -> x, !x for x(), and a delay layout block 2018-08-01 23:16:53 -04:00
Arya Irani
3924123584 syntax error in example 2018-08-01 22:21:30 -04:00
Arya Irani
1f6c4d86ec use splitAndRenderWithColor to minimize source output 2018-08-01 21:53:31 -04:00
Arya Irani
0e03bbd8e6 fix missing unparenthesized types in PrintError.renderType.paren 2018-08-01 21:45:50 -04:00
Arya Irani
74faf73c9f added example type
errors
2018-08-01 19:01:08 -04:00
Arya Irani
6622df402e debugging the error display for unison-src/tests/if.uu 2018-08-01 17:32:45 -04:00
Paul Chiusano
a222a46353 fix scala tests to for new Foo.+ (vs +_Foo) syntax for qualified operators, also reduced test sizes for Sequence a bit so they don't take forever 2018-07-30 09:30:13 -04:00
Paul Chiusano
ee3c8bd29a Added some notes and example errors, generalized Term a bit to allow type annotations to contain locations.
Moving `check` over to Context2 and still fixing compiler errors there
2018-07-10 17:36:10 -04:00
Arya Irani
a91b6c81a8 no more stack allocations for Stream
`fp_s` and `fppp_s` accept a function returning `EnvTo[Foo]`.
The environment is passed to the resulting `EnvTo[Foo]` before
encoding the `Foo` as normal.
2018-07-07 17:49:59 -04:00
Arya Irani
dcbe3cc4d8 seems to have largely fixed itself in my sleep
the typedecl parser for builtins seems to work fine
fixed prettyprinting of tuples
fixed logic error in OptionalTC.isEmpty
added tuple.u and unfold.u tests
2018-07-07 13:00:39 -04:00
Arya Irani
ea3b4291b5 wip/failing attempt to implement Stream.unfold, which requires an Option type
Somehow I broke Pair, or something to do with Pair wrapped in Option?
2018-07-06 23:58:12 -04:00
Arya Irani
a4ef66e645 bugfix and tests for Stream.flatMap 2018-07-05 23:10:30 -04:00
Arya Irani
1f556f0bb1 add tests for Stream.takeWhile/dropWhile/zipWith
untested: flatMap/constant (doesnt terminate)
2018-07-05 13:22:45 -04:00
Arya Irani
510e0c07aa add Stream.sum/append 2018-07-04 22:42:20 -04:00
Arya Irani
3063e7e57f add more Stream builtins and thread env through (see more...)
added `fs_p`, `fpps_p`, etc and the `StackDecode` typeclass, which describes how
  to decode a value which needs access to a stack.

builtin function adapter helper naming convention guide:
`u` = unison unboxed
`b` = Scala Boolean as unboxed booleana
`l` = Scala Long as unboxed int64
`n` = Scala Int as unboxed uint64
`d` = Scala Double as unboxed float
`p` = "polymorphic", some generic type not known to be unboxed
`s` = "stack decode", some input parameter requiring access to the runtime stack to be decoded
`z` = laZy, a result type for which the decompiled form has to be recorded with each operation, as opposed to being derived from a Value.

`p` is used when a function accepts a an `Env => Stream` that will not be consumed
`s` is used when a function accepts a `Stream` (no `Env`) that will be consumed
`z` is used when a function returns a `Stream`

add pretty printing for `Tuple` and `Sequence`
2018-07-04 21:32:56 -04:00
Arya Irani
724e93e1c8 boost HOF stack size and un-minify stream test 2018-06-29 18:44:57 -04:00
Arya Irani
593c7a6631 testing up the tests 2018-06-29 17:57:58 -04:00
Arya Irani
1d0f546a53 comments 2018-06-29 17:09:51 -04:00
Arya Irani
21935173d3 runtime FileCompilationTests 2018-06-29 15:42:59 -04:00
Runar Bjarnason
505d186b0d Base-58 straw man implementation 2018-06-27 17:12:17 -04:00
Paul Chiusano
c75eb1f4e1
Merge pull request #205 from unisonweb/master
merge master into wip/typechecker
2018-06-25 18:39:29 -05:00
Arya Irani
6a221273b8 first cut at atom editor support for unison files 2018-06-16 16:17:10 -04:00
Paul Chiusano
88d62e43c4 patterns now checked against scrutinee inferred type 2018-06-13 21:48:39 -04:00
Arya Irani
92f43221d3 typechecking for pattern-matching (untested) 2018-06-12 17:01:00 -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
Arya Irani
d961ddf8a2 Incremento! 2018-06-05 12:59:36 -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
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 Kinsky
08b8b1caeb fix invalid operator identifier error 2017-11-20 14:13:43 -08:00
Paul Chiusano
059d8f14fd node and shared tests now passing with new parser, also changed precedence of effect blocks to allow them to be used in operator expressions like foo <| do Remote { ... } 2016-12-13 12:07:43 -05:00
Paul Chiusano
52840857cf all shared tests now passing 2016-12-11 22:36:44 -05:00
Paul Chiusano
1e73a1a4be term and types parsing again, got all of base.u parsing 2016-11-29 22:47:39 -05:00
Paul Chiusano
5b8abcb9d0 more progress on add command, handling ambiguity 2016-10-30 11:18:11 -04:00
Paul Chiusano
3064280a56 cleanup, fix missed handling of key ordering 2016-10-12 09:32:17 -04:00
Paul Chiusano
69160d31ad fix html test, added a bit more diagnostics to searchengine.u 2016-10-11 17:24:38 -04:00
Paul Chiusano
e640c59693 added delimiter between search results 2016-10-11 17:00:23 -04:00
Paul Chiusano
c5a1c6fed2 clean up search engine example and add a few more builtins 2016-10-11 16:53:00 -04:00
Paul Chiusano
ad3f52250a some search engine tweaks, spawning crawlers from multiple roots 2016-10-07 17:01:36 -04:00
Paul Chiusano
6e8a4df406 minor tweaks to searchengine.u 2016-10-07 16:13:22 -04:00
Paul Chiusano
4459246024 rename Node -> Codebase, split out evaluation functions, tests passing in shared 2016-10-07 12:37:51 -04:00
Paul Chiusano
3fe4807d55 search engine implementation + various utilities and tweaks 2016-10-05 16:57:32 -04:00
Paul Chiusano
75a24f5a7c update sort call, due to rename 2016-10-04 21:00:34 -04:00
Paul Chiusano
9b4233e079 Vector.dedup and Order.equal 2016-10-04 20:53:51 -04:00
Paul Chiusano
e3e134cb83 Text.take/drop/words, Vector.dedup-adjacent 2016-10-04 20:37:59 -04:00
Paul Chiusano
d18364fa84 Fix quadratic performance bug in interpreter, added simple test of indexed traversal 2016-10-03 13:50:48 -04:00
Paul Chiusano
47f891d1f5 fix issue with IndexedTraversal.intersect 2016-09-30 14:34:33 -04:00
Paul Chiusano
c7e698b036 missed a few eval calls 2016-09-26 20:21:38 -04:00
Paul Chiusano
dbb2cd0de2 convert to strict interpreter, add if-then-else syntax 2016-09-26 17:59:13 -04:00
Paul Chiusano
328939809c DIndex seems to be working, added simple test 2016-09-15 13:03:24 -04:00
Paul Chiusano
2eaacba7e0 fix issues with Remote.sleep and Remote.race 2016-09-15 12:35:16 -04:00
Paul Chiusano
4e4b1e17ae Remote.send is strict 2016-09-15 00:09:51 -04:00
Paul Chiusano
d62745a74d added receive-async example, toned down logging 2016-09-15 00:06:02 -04:00
Paul Chiusano
5b844512c0 got rid of node worker processes, spawning node worker in same process 2016-09-14 12:31:41 -04:00
Paul Chiusano
0dc9e37a47 fix compile errors in dindex.u and extra.u 2016-09-13 11:54:59 -04:00
Paul Chiusano
2f70ae7407 Merge remote-tracking branch 'origin/topic/searchengine' into topic/searchengine 2016-09-13 11:43:59 -04:00
Paul Chiusano
5a2ee0c5af using type aliases in dindex.u 2016-09-13 11:43:35 -04:00
Sam Griffin
5e7f3aff10 fixed old references to Optional.getOr 2016-09-02 03:27:34 +00:00
Paul Chiusano
7b1e574ea6 Optional.getOr => Optional.get-or, down with CamelCase!! 2016-08-30 10:06:10 -04:00
Paul Chiusano
93c9f84b52 rename Vector.split to Vector.halve, add Vector.sort' 2016-08-29 17:12:43 -04:00
Paul Chiusano
02227a56e9 IndexedTraversals done + some other std library tweaks 2016-08-28 23:51:13 -04:00
Paul Chiusano
c0663e2fe8 Adding indexed traversals WIP 2016-08-28 16:45:37 -04:00
Paul Chiusano
30d9d89fe1 Much nicer ordering support, including arbitrary pairs, inverting orders, etc 2016-08-28 15:40:36 -04:00
Paul Chiusano
50367dd5c6 qualified operator infix syntax - a ==_Text b, and removed use of camel case in Unison 2016-08-28 00:05:09 -04:00
Paul Chiusano
a886c063b8 lots of std lib improvements / fixes to support DIndex 2016-08-24 17:16:26 -04:00
Paul Chiusano
1331400b1d Vector.zip/bind/pure 2016-08-23 22:02:08 -04:00
Paul Chiusano
33f83dcfeb Vector.at/take/drop 2016-08-23 21:27:59 -04:00
Paul Chiusano
09eaa3db1d Index.{keys,increment} functions, added better error for unresolved symbols, defined various functions in Unison instead of ExtraBuiltins 2016-08-23 16:10:47 -04:00
Paul Chiusano
968733efb3 some std lib naming tweaks, modified type parser to allow dots in identifiers 2016-08-23 12:58:43 -04:00
Paul Chiusano
18d3fcd6dc Vector.range, replicate, replicateM 2016-08-22 22:29:44 -04:00
Paul Chiusano
eb7a9fb785 more standard library - hashing functions, traversal, sequencing, folds 2016-08-22 17:00:52 -04:00
Paul Chiusano
1d4e3210d5 get rid of hacky layout support, tweak syntax, build up standard library 2016-08-22 15:27:13 -04:00
Paul Chiusano
441e41311a move all unison files to unison-src directory 2016-08-21 17:58:07 -04:00
Paul Chiusano
632fc73cf9 ignore layout tokens during type parsing 2016-08-21 17:55:12 -04:00
Paul Chiusano
78c3cddef0 added layout blocks, using for do blocks and let bindings, altered syntax of let bindings to closer match do blocks 2016-08-21 17:33:20 -04:00
Paul Chiusano
fdac639034 examples working again, needed to resurrect Remote.map builtin 2016-08-20 16:27:54 -04:00
Paul Chiusano
d00c3f1cfa hacking to get node workers loading base.u and extra.u from file 2016-08-19 17:46:10 -04:00
Paul Chiusano
31f6072231 splitting base out into separate .u file, which is now parsed by tests 2016-08-18 17:24:03 -04:00