Commit Graph

248 Commits

Author SHA1 Message Date
Gabriel Gonzalez
eb489b3c5c Improve error messages 2016-11-20 15:45:40 -08:00
Gabriel Gonzalez
02f7fa7e73 Add Note constructors for each operator
This improves the localization of source extracts for operator-related errors
2016-11-20 15:37:32 -08:00
Gabriel Gonzalez
846b73d666 Improve error messages 2016-11-20 14:30:09 -08:00
Gabriel Gonzalez
6ed1b1f7e6 Improve error messages 2016-11-20 14:18:40 -08:00
Gabriel Gonzalez
39d01168c1 Improve error messages 2016-11-20 14:10:28 -08:00
Gabriel Gonzalez
5bc3816176 Improve error messages 2016-11-20 13:55:32 -08:00
Gabriel Gonzalez
f228bb93d7 Forbid duplicate fields in records and unions 2016-11-18 09:09:17 -08:00
Gabriel Gonzalez
e79219d7ea Improve error messages 2016-11-17 17:31:55 -08:00
Gabriel Gonzalez
f0b2cce832 Improve error messages 2016-11-17 17:22:21 -08:00
Gabriel Gonzalez
43e8e59d81 Revert "Permit record fields to be types"
This reverts commit a8f022e652.
2016-11-17 17:09:29 -08:00
Gabriel Gonzalez
a8f022e652 Permit record fields to be types
This is to be pedantic in ensuring that a record type should type check if the
equivalent Boehm-Berarducci encoding type-checks.  For example, the following
record type:

    { x : Type }

... is technically valid when Boehm-Berarducci-encoded:

    ∀(record : Type) → ∀(make : ∀(x : Type) → record) → record

... even if this is totally useless because you can't actually extract the
type from the record or use it as a type for another field.
2016-11-17 10:05:17 -08:00
Gabriel Gonzalez
c4825f1df8 Improve error messages 2016-11-17 09:39:47 -08:00
Gabriel Gonzalez
5d1bd558cc Improve error messages 2016-11-17 09:14:05 -08:00
Gabriel Gonzalez
84016d9f0e Fix parsing block comments at beginning of file 2016-11-15 09:23:41 -08:00
Gabriel Gonzalez
9f7d8c2790 Improve error messages 2016-11-15 09:18:12 -08:00
Gabriel Gonzalez
0b071a3d1d Improve error messages 2016-11-15 09:14:11 -08:00
Gabriel Gonzalez
26f3ac0563 Improve error messages 2016-11-15 08:57:36 -08:00
Gabriel Gonzalez
81d8e61e27 Improve error messages 2016-11-15 08:44:52 -08:00
Gabriel Gonzalez
8fad4b06a5 Improve error messages 2016-11-13 17:17:06 -08:00
Gabriel Gonzalez
6563734c9f Improve parsing speed
Parsing `App` with source annotations was using a really inefficient form of
backtracking which greatly slowed down the speed of parsing.  This change uses a
non-backtracking solution that still preserves source annotations which gives a
10x speed up on some small test programs like this one:

      λ(n : Natural)
    → λ(a : Type)
    → λ(f : Natural → a)
    → List/build
      a
      ( λ(list : Type)
      → λ(cons : a → list → list)
      → List/fold
        { index : Natural, value : {} }
        ( List/indexed
          {}
          ( List/build
            {}
            ( λ(list : Type)
            → λ(cons : {} → list → list)
            → Natural/fold n list (cons {=})
            )
          )
        )
        list
        (λ(x : { index : Natural, value : {} }) → cons (f x.index))
      )
2016-11-13 16:51:08 -08:00
Gabriel Gonzalez
7a13e246e0 Improve parsing speed
There was a needless use of backtracking in the implementation of `exprA` that
incurred a significant performance cost.  Left-factoring the `exprA` parser
improves speed significantly
2016-11-13 15:58:17 -08:00
Gabriel Gonzalez
2781f384fb Improve error messages 2016-11-13 15:40:38 -08:00
Gabriel Gonzalez
46523d64ea Improve error messages 2016-11-13 14:59:28 -08:00
Gabriel Gonzalez
6a054c7fb3 Fix normalization bug for merge 2016-11-13 14:56:14 -08:00
Gabriel Gonzalez
23c9481f87 Improve error messages 2016-11-13 14:32:15 -08:00
Gabriel Gonzalez
0e0bbae04e Improve error messages 2016-11-13 14:24:27 -08:00
Gabriel Gonzalez
7538cd3152 Improve error messages 2016-11-13 14:04:38 -08:00
Gabriel Gonzalez
a2a7075a14 Improve error messages 2016-11-13 10:44:32 -08:00
Gabriel Gonzalez
1fa532c16f Improve error messages 2016-11-13 10:33:29 -08:00
Gabriel Gonzalez
7b39d047c3 Improve error messages 2016-11-13 10:23:42 -08:00
Gabriel Gonzalez
f2a51c6f45 Improve error messages 2016-11-13 10:14:40 -08:00
Gabriel Gonzalez
d93e0dd7bf Improve error messages 2016-11-12 17:47:09 -08:00
Gabriel Gonzalez
69573d822e Improve error messages 2016-11-12 17:30:48 -08:00
Gabriel Gonzalez
57f3658ebf Improve error messages 2016-11-12 17:01:03 -08:00
Gabriel Gonzalez
f757e4c87f Improve error messages 2016-11-12 16:35:49 -08:00
Gabriel Gonzalez
e7cca468ee Improve error messages 2016-11-12 16:22:22 -08:00
Gabriel Gonzalez
51815e0c49 Thicken angle brackets used to delimit inline code 2016-11-12 13:45:04 -08:00
Gabriel Gonzalez
56d4ec88bc Improve error messages 2016-11-12 10:29:41 -08:00
Gabriel Gonzalez
90bd4596b6 Improve error messages 2016-11-12 10:18:34 -08:00
Gabriel Gonzalez
2ac9ca5874 Improve error messages 2016-11-12 09:57:31 -08:00
Gabriel Gonzalez
e5d74a3c6f Fix display of Imported exceptions 2016-11-12 08:59:51 -08:00
Gabriel Gonzalez
57bab5d19c Improve error messages 2016-11-12 08:53:49 -08:00
Gabriel Gonzalez
713499b94d Improve error messages 2016-11-12 08:52:10 -08:00
Gabriel Gonzalez
7fe24bc8c4 Rename Maybe to Optional
The primary reason for this change is to make it easier to describe these values
both in documentation and in informal communication between developers.

Before, you'd have to say things like:

* A value of type `Maybe` (incorrect)
* A `Maybe` value (sounds weird)
* A value of type `Maybe a` for some `a` (correct, but very verbose)

Now you can say an `Optional` value and the meaning is precise and clear

A secondary reason for this change is to keep the terminology close to the
intended use of the language for configuration files.  Describing fields as
`Optional` instead of `Maybe` makes a lot of sense for configurations.

The disadvantage is that some uses of `Optional` don't make sense.  For example,
consider the type of `List/head`:

    List/head : ∀(a : Type) → List a → Optional a

It seems weird to say that the result of `List/head` is `Optional`.  However,
many languages (such as Java/Scala/F#/Swift) already use this name or `Option` and
they get along just fine.
2016-11-12 08:31:13 -08:00
Gabriel Gonzalez
091b4cb36b Improve error messages 2016-11-12 07:59:18 -08:00
Gabriel Gonzalez
d60677ca53 Improve error messages 2016-11-11 20:39:32 -08:00
Gabriel Gonzalez
950ea635af Improve error messages 2016-11-11 14:45:32 -08:00
Gabriel Gonzalez
c64d2a2dde Improve error messages 2016-11-11 14:31:23 -08:00
Gabriel Gonzalez
20e5ac5c9b Improve error messages 2016-11-09 22:33:46 -08:00
Gabriel Gonzalez
6791f831d9 Improve error messages 2016-11-09 17:37:50 -08:00