Commit Graph

23 Commits

Author SHA1 Message Date
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
1ac704ad76 Add source annotation for values read into Haskell via input 2016-11-05 08:36:16 -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
9b7aa9dad3 Remove old parser implementation 2016-10-30 19:31:47 -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
Gabriel Gonzalez
2909f8871b Add Note constructor 2016-10-29 21:48:18 -07:00
Gabriel Gonzalez
323cbdf289 Move the X type to the Dhall.TypeCheck module
... since it's not used in the `Dhall.Core` module at all
2016-10-18 09:18:01 -07:00
Gabriel Gonzalez
51a86a1ec8 Move type-checking logic to separate Dhall.TypeCheck module
The error messages alone warranted separating this out into a separate module
2016-10-17 18:34:51 -07:00
Gabriel Gonzalez
79ed8f300e Add support for decoding sum types into Haskell 2016-10-15 17:35:51 -07:00
Gabriel Gonzalez
91a933ba9a Use Builder internally for representing Text
This is more efficient since the only thing we ever do is concatenate text,
which `Builder` is optimized for.
2016-10-11 09:18:52 -07:00
Gabriel Gonzalez
076678f1de Add support for decoding Maybes 2016-09-18 15:38:36 -07:00
Gabriel Gonzalez
d39cf8876e Re-export Text 2016-09-18 15:24:54 -07:00
Gabriel Gonzalez
0da0968147 Polish documentation 2016-09-16 20:23:12 -07:00
Gabriel Gonzalez
d0a4134e25 Reintroduce Unicode support 2016-09-16 20:16:46 -07:00
Gabriel Gonzalez
c5b781e03e Change list literal syntax
Move the type annotation outside the list

This is to prepare for an equivalent syntax for `Maybe` literals
2016-09-15 09:34:55 -07:00
Gabriel Gonzalez
6580a4cbf1 Change [ a ] to List a 2016-09-15 09:03:12 -07:00
Gabriel Gonzalez
a4c2b5bca7 Update documentation 2016-09-12 21:27:47 -07:00
Gabriel Gonzalez
5cc537824b Update documentation 2016-09-12 21:20:55 -07:00
Gabriel Gonzalez
d3998b09a2 Switch to happy for parsing and simplify the alex lexer 2016-09-11 20:38:37 -07:00
Gabriel Gonzalez
f6990dd1af Update tutorial 2016-09-11 10:55:34 -07:00
Gabriel Gonzalez
d03a900583 Update documentation 2016-09-09 19:02:13 -07:00
Gabriel Gonzalez
b313facaa2 Update documentation 2016-09-09 09:51:31 -07:00
Gabriel Gonzalez
3a2faaa4fb Add support for decoding into records using GHC generics
Also began the tutorial
2016-09-09 09:17:25 -07:00