← 返回命令列表

Linux command

dhall 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Evaluate a Dhall expression

dhall <<< "[expression]"

Evaluate a Dhall file

dhall < [config.dhall]

Convert Dhall to JSON

dhall-to-json <<< "[expression]"

Convert Dhall to YAML

dhall-to-yaml < [config.dhall]

Type check a Dhall file

dhall type < [config.dhall]

Format a Dhall file

dhall format < [config.dhall]

Convert JSON to Dhall

json-to-dhall '[Type]' < [data.json]

说明

Dhall is a programmable configuration language that guarantees termination. It provides the power of a programming language (functions, types, imports) while ensuring configurations always produce a result without infinite loops. Dhall expressions can be converted to JSON, YAML, or other formats for consumption by applications. The language features a strong type system that catches configuration errors at evaluation time. Key features include: remote imports with integrity checking (content-addressed dependencies), a total type system (no runtime errors), and built-in functions for common transformations.

参数

type
Infer and display the type of an expression.
normalize
Normalize an expression.
format
Format Dhall source code.
lint
Improve Dhall expressions.
diff
Show differences between two expressions.
hash
Compute semantic hash of expression.
freeze
Add integrity checks to imports.
encode / decode
Binary encoding/decoding.
--explain
Provide detailed error explanations.
--ascii
Use ASCII output instead of Unicode.

FAQ

What is the dhall command used for?

Dhall is a programmable configuration language that guarantees termination. It provides the power of a programming language (functions, types, imports) while ensuring configurations always produce a result without infinite loops. Dhall expressions can be converted to JSON, YAML, or other formats for consumption by applications. The language features a strong type system that catches configuration errors at evaluation time. Key features include: remote imports with integrity checking (content-addressed dependencies), a total type system (no runtime errors), and built-in functions for common transformations.

How do I run a basic dhall example?

Run `dhall <<< "[expression]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does type do in dhall?

Infer and display the type of an expression.