diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-04-05 16:33:56 +0200 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-04-05 16:33:56 +0200 |
commit | 200d77d107277ce4d747e64dbe3ec01a679cea08 (patch) | |
tree | b8cd1db1d35fbb7241a36e6ef38c8bd44072e88a /doc/guide.pandoc | |
parent | 359a8c39b82ddb4f423c707e7a95771d4668b127 (diff) |
more documentation
Diffstat (limited to 'doc/guide.pandoc')
-rw-r--r-- | doc/guide.pandoc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/doc/guide.pandoc b/doc/guide.pandoc index d1d31538..2493375e 100644 --- a/doc/guide.pandoc +++ b/doc/guide.pandoc | |||
@@ -442,18 +442,19 @@ Design decisions | |||
442 | 442 | ||
443 | - use a dependently typed core language (treat types as values) | 443 | - use a dependently typed core language (treat types as values) |
444 | This gives more expressive power to static typing and somewhat simplifies the compiler at the same time. | 444 | This gives more expressive power to static typing and somewhat simplifies the compiler at the same time. |
445 | - type checking is based on [LambdaPi](https://www.andres-loeh.de/LambdaPi/) | ||
446 | - use bidirection type checking | ||
447 | - do type inference and reduction in one step | ||
448 | - separate types and expressions | ||
445 | - all code completion task is done by inferring values of hidden variables in the following two intermangled phases: | 449 | - all code completion task is done by inferring values of hidden variables in the following two intermangled phases: |
446 | 1. make hidden arguments (type applications, type class witnesses) explicit by inserting metavariables | 450 | 1. make hidden arguments (type applications, type class witnesses) explicit by inserting metavariables |
447 | 2. eliminate metavariables | 451 | 2. eliminate metavariables |
448 | - use bidirection type checking | ||
449 | - use a rich context | 452 | - use a rich context |
450 | With this, the inference algorithm can take into account not just the types of bounded variables but also the fact that the expression is part of an application and more. | 453 | With this, the inference algorithm can take into account not just the types of bounded variables but also the fact that the expression is part of an application and more. |
451 | - use the context as a zipper | 454 | - use the context as a zipper |
452 | The context is literally the context of the expression, so it can be used as a zipper. As a bonus, the type inference algorithm will be tail recursive. | 455 | The context is literally the context of the expression, so it can be used as a zipper. As a bonus, the type inference algorithm will be tail recursive. |
453 | - do type inference and reduction in one step | ||
454 | - keep the unreduced form of expressions too | 456 | - keep the unreduced form of expressions too |
455 | - use labels to remember the beginning of right hand side instead of arity information | 457 | - use labels to remember the beginning of right hand side instead of arity information |
456 | - separate types and expressions | ||
457 | - erease types when possible | 458 | - erease types when possible |
458 | 459 | ||
459 | 460 | ||
@@ -498,6 +499,13 @@ subexpression rich context | |||
498 | -------------------------- ------------------------------ | 499 | -------------------------- ------------------------------ |
499 | 500 | ||
500 | 501 | ||
502 | Rich context as a zipper | ||
503 | ------------------------ | ||
504 | |||
505 | The rich context contains the real context of the subexpression, together with the path to the subexpression. | ||
506 | In fact, the rich context is very close to the zipper of expressions. | ||
507 | |||
508 | The type inference algorithm becomes tails recursive if its arguments are the rich context and the subexpression. | ||
501 | 509 | ||
502 | 510 | ||
503 | Solving metavariables | 511 | Solving metavariables |