Commit Graph

6 Commits

Author SHA1 Message Date
Gabriel Gonzalez
45a7f8cbb7 Add support for additional headers for URL imports. Fixes #45 (#71)
Users can now supply additional headers for URL imports using the new `using`
keyword, like this:

```haskell
http://example.com using ./headers
```

... where `./headers` must be a value of type:

```haskell
{ header : Text, value : Text }
```

The argument to `using` must be an import (such as a file, URL, or env import)
and cannot be an inline Dhall expression.  There are two reasons why:

* The header expression is resolved, type-checked, and normalized in a separate
  phase preceding the import of the corresponding URL so it does not have access
  to bound variables in scop
* This restriction greatly simplifies the implementation

Also, headers are automatically forwarded to relative imports, so if you import a
URL like this:

```haskell
http://example.com using ./headers
```

... and that serves a file like:

```haskell
./foo
```

... then Dhall will import `http://example.com/foo` using the same `./headers`.
2017-06-17 07:14:37 -07:00
Gabriel Gonzalez
e06791c6c1 Update default.nix 2017-05-17 09:04:42 -07:00
Gabriel Gonzalez
e0319ecaa5 Forbid additional characters from paths (#58)
This reduces the number of situations where users have to end a path
with a space
2017-05-16 09:17:19 -07:00
Gabriel Gonzalez
4b8d8438ea Update default.nix 2017-04-29 14:46:07 -07:00
Gabriel Gonzalez
c54353c3ee Replace microlens* dependencies with lens. Fixes #20
`trifecta` already depends on `lens`, so using `microlens` does not
actually trim down the dependency tree.  Quite the opposite: it adds two
unnecessary dependencies.
2017-01-29 14:44:09 -08:00
Gabriel Gonzalez
56365164ca Add Nix derivations for building Dhall 2016-12-19 20:27:15 -08:00