Commit Graph

206 Commits

Author SHA1 Message Date
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
Gabriel Gonzalez
dea3faf22a Fix parsing of Double literals 2016-11-05 08:09:47 -07:00
Gabriel Gonzalez
d393963888 Simplify command line interface and add --explain 2016-11-04 21:41:47 -07:00
Gabriel Gonzalez
b81a85a0ad Update package description 2016-11-03 21:25:23 -07:00
Gabriel Gonzalez
b076ca2e77 Remove unused dependencies 2016-11-03 21:22:03 -07:00
Gabriel Gonzalez
9622c98f06 Remove unused dependencies 2016-11-03 21:20:31 -07:00
Gabriel Gonzalez
eafb926a75 Remove unnecessary alex/happy build dependencies 2016-11-03 21:16:20 -07:00
Gabriel Gonzalez
e23885f315 Add version bounds to dependencies 2016-11-03 21:15:34 -07:00
Gabriel Gonzalez
0e36b29641 Rename apply to merge 2016-11-03 17:51:19 -07:00
Gabriel Gonzalez
e3850beed6 Use (stdin) and (input) in Trifecta error messages
... instead of `(interactive)`
2016-11-03 09:40:29 -07:00
Gabriel Gonzalez
10d67551ea Attach URL information to Trifecta error messages 2016-11-03 09:26:07 -07:00
Gabriel Gonzalez
c6c8ed918e Move all URL import logic into exprFromURL 2016-11-03 09:05:47 -07:00
Gabriel Gonzalez
96c42c5b14 Factor out all file import logic into exprFromFile 2016-11-03 08:12:44 -07:00
Gabriel Gonzalez
cb4dc023ab Move exprFromFile to Dhall.Import 2016-11-03 07:54:44 -07:00
Gabriel Gonzalez
4873a40980 Change parsing errors to display file name when parsing files 2016-11-01 17:44:00 -07:00
Gabriel Gonzalez
832d369fad Narrow identifiers to only permit ASCII letters and numbers 2016-11-01 17:20:59 -07:00
Gabriel Gonzalez
50d58426cc Improve accuracy of source location for App 2016-11-01 17:15:44 -07:00
Gabriel Gonzalez
7135d8dc66 Polish error messages 2016-11-01 16:59:19 -07:00
Gabriel Gonzalez
24598e6f60 Revert "Improve efficiency of Context implementation"
The old implementation produces better error messages because it preserves the
original order in which variables were bound.  For example, if you wrote:

    λ(a : Type) → λ(x : a) → y

... under the `Map`-based implementation, that would give the following
out-of-order `Context` when displaying the error message:

    Context:
    x : a
    a : Type

... but with the old list-based implementation, the correct order is presented:

    Context:
    a : Type
    x : a
2016-11-01 09:09:15 -07:00
Gabriel Gonzalez
acce67fca7 Output short error message by default 2016-11-01 09:04:19 -07:00
Gabriel Gonzalez
496173d8c9 Strip surrounding whitespace from code fragment 2016-11-01 07:56:03 -07:00
Gabriel Gonzalez
4325c340fa Remove unnecessary newline from error messages 2016-10-30 20:38:19 -07:00
Gabriel Gonzalez
5d452450f7 Add more source annotations to source tree 2016-10-30 20:30:20 -07:00
Gabriel Gonzalez
c55ba34f5f Add basic source/position information to error message output 2016-10-30 20:24:35 -07:00
Gabriel Gonzalez
9b7aa9dad3 Remove old parser implementation 2016-10-30 19:31:47 -07:00
Gabriel Gonzalez
2b7e0f3c26 Fix last known issues in parser 2016-10-30 19:28:36 -07:00
Gabriel Gonzalez
20c56b0cb1 Fix missing parser for Bool 2016-10-30 19:21:58 -07:00
Gabriel Gonzalez
1c53d7872f Fix parsing for field accessors 2016-10-30 19:07:32 -07:00
Gabriel Gonzalez
432f446ded Left-factor Var parser to improve error messages 2016-10-30 18:58:43 -07:00
Gabriel Gonzalez
23340e64d9 Left-factor exprE to improve error messages 2016-10-30 18:55:52 -07:00
Gabriel Gonzalez
f2209efb8c Left factor parsing for exprB to improve error messages 2016-10-30 18:40:00 -07:00
Gabriel Gonzalez
13eddef662 Initial switch to new trifecta-based parser
Still several bugs to work out
2016-10-30 18:33:14 -07:00