From 175b14951e46b4d980839fd719b8b7a64968c073 Mon Sep 17 00:00:00 2001 From: Clement Delafargue Date: Mon, 1 Jul 2019 16:32:58 +0200 Subject: dhall: expose optional fields as optional values Instead of `nonifying` them --- dhall/Config.dhall | 10 +++++----- dhall/mkConfig.dhall | 12 ++++-------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/dhall/Config.dhall b/dhall/Config.dhall index db063b7..c095403 100644 --- a/dhall/Config.dhall +++ b/dhall/Config.dhall @@ -10,17 +10,17 @@ in λ(Environment : Type) , clever_token : Text , clever_syslog_server : - Text + Optional Text , clever_domain : - Text + Optional Text , clever_app_tasks_file : - Text + Optional Text , clever_haskell_entry_point : - Text + Optional Text , clever_metrics : Bool , clever_addons : List Addon , clever_env : Environment - } \ No newline at end of file + } diff --git a/dhall/mkConfig.dhall b/dhall/mkConfig.dhall index 37b029a..ae84b21 100644 --- a/dhall/mkConfig.dhall +++ b/dhall/mkConfig.dhall @@ -4,10 +4,6 @@ let Vault = ./Vault.dhall let Addon = ./addon/Addon.dhall -let nonifyEmpty = - λ(opt : Optional Text) - → Optional/fold Text opt Text (λ(x : Text) → x) "None" - in λ(vault : Vault) → λ(app : Text) → λ(organization : Text) @@ -26,13 +22,13 @@ in λ(vault : Vault) , clever_token = vault.token , clever_syslog_server = - nonifyEmpty syslogServer + syslogServer , clever_domain = - nonifyEmpty domain + domain , clever_app_tasks_file = - nonifyEmpty tasksFile + tasksFile , clever_haskell_entry_point = - nonifyEmpty entryPoint + entryPoint , clever_metrics = metrics , clever_addons = -- cgit v1.2.3