Dhall是一种可编程的配置语言,可以理解成:JSON+functions+types+imports。
{-Youcanoptionallyaddtypes`x:T`meansthat`x`hastype`T`-}letConfig:Type={-Whathappensifyouaddanotherfieldhere?-}{home:Text,privateKey:Text,publicKey:Text}letmakeUser:Text->Config=\(user:Text)->lethome:Text="/home/${user}"letprivateKey:Text="${home}/.ssh/id_ed25519"letpublicKey:Text="${privateKey}.pub"letconfig:Config={home=home,privateKey=privateKey,publicKey=publicKey}inconfigletconfigs:ListConfig=[makeUser"bill",makeUser"jane"]inconfigs
评论