dhall-text 1.0.14 → 1.0.15
raw patch · 2 files changed
+38/−34 lines, 2 filesdep ~dhall
Dependency ranges changed: dhall
Files
- README.md +36/−32
- dhall-text.cabal +2/−2
README.md view
@@ -1,12 +1,18 @@-# `dhall-text 1.0.14`+# `dhall-text` -[](https://hackage.haskell.org/package/dhall-text)+For installation or development instructions, see: +* [`dhall-haskell` - `README`](https://github.com/dhall-lang/dhall-haskell/blob/master/README.md)++## Introduction+ This `dhall-text` package provides a `dhall-to-text` executable which you can use to template text using the Dhall configuration language. -For example, suppose you save the following files to your current directory:+## Example +Suppose you save the following files to your current directory:+ ```haskell $ cat Person -- Dhall is a typed programming language@@ -24,13 +30,14 @@ , { name = "Pranav", upvotes = 1 } ] --- This file has type:------ ./people : List { name : Text, upvotes : Natural }------ ... or just:------ ./people : List ./Person+{- This file has type:+ + ./people : List { name : Text, upvotes : Natural }+ + ... or just:+ + ./people : List ./Person+-} ``` ```haskell@@ -38,31 +45,36 @@ -- You can define anonymous functions in Dhall using a backslash (i.e. `\`) \(person : ./Person) -- You can import any type or expression by its path - -- Dhall supports multiline strings that strip leading whitespace and Dhall- -- supports string interpolation, too, using `${...}` syntax--> ''+ {- Dhall supports multiline strings that strip leading whitespace and Dhall+ supports string interpolation, too, using `${...}` syntax+ -}+-> '' <li class="list-group-item"> <span class="badge">${Natural/show person.upvotes}</span> ${person.name} </li> '' --- This file has type:------ ./make-item : ./Person -> Text+{- This file has type:+ + ./make-item : ./Person -> Text+-} ``` ```haskell $ cat make-items- -- You can also import any type or expression by its URL- let List/map = https://raw.githubusercontent.com/dhall-lang/Prelude/302881a17491f3c72238975a6c3e7aab603b9a96/List/map-in let Text/concat = https://raw.githubusercontent.com/dhall-lang/Prelude/302881a17491f3c72238975a6c3e7aab603b9a96/Text/concat-in \(people : List ./Person)--> Text/concat (List/map ./Person Text ./make-item people)+-- You can also import any type or expression by its URL+let List/map = https://prelude.dhall-lang.org/List/map --- This file has type:------ ./make-items : List ./Person -> Text+let Text/concat = https://prelude.dhall-lang.org/Text/concat++in \(people : List ./Person) ->+ Text/concat (List/map ./Person Text ./make-item people)++{- This file has type:+ + ./make-items : List ./Person -> Text+-} ``` Templating HTML is just ordinary function application:@@ -88,11 +100,3 @@ To learn more about the Dhall configuration language, [read the tutorial](https://hackage.haskell.org/package/dhall/docs/Dhall-Tutorial.html)--## Quick start--If you have Nix then you can install this package using:--```bash-$ nix-env --install --file default.nix-```
dhall-text.cabal view
@@ -1,5 +1,5 @@ Name: dhall-text-Version: 1.0.14+Version: 1.0.15 Cabal-Version: >=1.8.0.2 Build-Type: Simple Tested-With: GHC == 7.10.2, GHC == 8.0.1@@ -25,7 +25,7 @@ Main-Is: Main.hs Build-Depends: base >= 4.8.0.0 && < 5 ,- dhall >= 1.15.0 && < 1.20,+ dhall >= 1.15.0 && < 1.21, optparse-applicative < 0.15, text >= 0.11.1.0 && < 1.3 GHC-Options: -Wall