Dhall is a data notation created in 2017.
#133on PLDB | 7Years Old | 817Repos |
git clone https://github.com/dhall-lang/dhall-lang
Maintainable configuration files
-- ./company.dhall
let Prelude =
https://prelude.dhall-lang.org/v19.0.0/package.dhall sha256:eb693342eb769f782174157eba9b5924cf8ac6793897fc36a31ccbd6f56dafe2
let companyName = "Example Dot Com"
let User = { name : Text, account : Text, age : Natural }
let users
: List User
= [ { name = "John Doe", account = "john", age = 23 }
, { name = "Jane Smith", account = "jane", age = 29 }
, { name = "William Allen", account = "bill", age = 41 }
]
let toEmail = \(user : User) -> "${user.account}@example.com"
let Bio = { name : Text, age : Natural }
let toBio = \(user : User) -> user.(Bio)
let companySize = Prelude.List.length User users
let greetingPage =
''
<html>
<title>Welcome to ${companyName}!</title>
<body>
<p>Welcome to our humble company of ${Natural/show companySize} people!</p>
</body>
</html>
''
in { emails = Prelude.List.map User Text toEmail users
, bios = Prelude.List.map User Bio toBio users
, greetingPage = greetingPage
}
{ output = "Hello, world!" }
Feature | Supported | Example | Token |
---|---|---|---|
Comments | ✓ | -- A comment | |
Line Comments | ✓ | -- A comment | -- |
Semantic Indentation | X |