Commit Graph

237 Commits

Author SHA1 Message Date
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
Gabriel Gonzalez
2586682bcc Fix parsing of ++ operator
Dhall was failing to parse `++` because the `+` operator was being parsed with
higher priority.  The fix is to switch the order in which the two operator
parses are tried
2016-11-09 17:30:27 -08:00
Gabriel Gonzalez
53fd657827 Improve error messages 2016-11-09 17:06:59 -08:00
Gabriel Gonzalez
60b6b2008d Improve error messages 2016-11-09 09:27:44 -08:00
Gabriel Gonzalez
441dc159e3 Improve error messages 2016-11-08 09:35:39 -08:00
Gabriel Gonzalez
e2002fb966 Fix variable not being templated in error message 2016-11-08 08:54:40 -08:00
Gabriel Gonzalez
75a4a5fe9c Improve error messages 2016-11-06 10:21:25 -08:00
Gabriel Gonzalez
096e6c8980 Improve error messages 2016-11-06 08:45:30 -08:00
Gabriel Gonzalez
e98b52aa9f Improve some error messages 2016-11-05 21:27:41 -07:00
Gabriel Gonzalez
4bee5b3bb6 Fix --explain to work when type-checking imported paths 2016-11-05 20:36:54 -07:00
Gabriel Gonzalez
ba2fc6e334 Don't show --explain hint when using input 2016-11-05 08:42:53 -07:00
Gabriel Gonzalez
1ac704ad76 Add source annotation for values read into Haskell via input 2016-11-05 08:36:16 -07:00