From b20dba92110ddf2e665add788d40abe73bd1fec0 Mon Sep 17 00:00:00 2001 From: Martin Schwaighofer Date: Thu, 22 Jul 2021 11:57:59 +0200 Subject: [PATCH] replace deprecated Optional/fold using Prelude See: https://docs.dhall-lang.org/howtos/migrations/Deprecation-of-Optional-fold-and-Optional-build.html This closes issue #3. --- render/Attributes.dhall | 2 +- render/Config.dhall | 4 ++-- render/Disclose.dhall | 2 +- render/Hilite.dhall | 5 +++-- render/MenuColor.dhall | 3 ++- render/ParanoidConfirmation.dhall | 2 +- render/Scores.dhall | 6 +++--- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/render/Attributes.dhall b/render/Attributes.dhall index 32568b9..17058f5 100644 --- a/render/Attributes.dhall +++ b/render/Attributes.dhall @@ -5,7 +5,7 @@ let types = ../types.dhall let renderAttribute = λ(name : Text) → λ(x : Optional Bool) - → Optional/fold + → Prelude.Optional.fold Bool x (List Text) diff --git a/render/Config.dhall b/render/Config.dhall index 58f4144..474a8c3 100644 --- a/render/Config.dhall +++ b/render/Config.dhall @@ -28,7 +28,7 @@ let renderOptional = λ(a : Type) → λ(f : a → Text) → λ(optional : Optional a) - → Optional/fold a optional Text (λ(x : a) → renderOptions (f x)) "" + → Prelude.Optional.fold a optional Text (λ(x : a) → renderOptions (f x)) "" let renderNamedOptional = λ(a : Type) @@ -65,7 +65,7 @@ let renderOptionalEnabled = let renderOptionalTopLevel = λ(name : Text) → λ(x : Optional Text) - → Optional/fold + → Prelude.Optional.fold Text x Text diff --git a/render/Disclose.dhall b/render/Disclose.dhall index a1de31c..7dc30f7 100644 --- a/render/Disclose.dhall +++ b/render/Disclose.dhall @@ -7,7 +7,7 @@ let renderDisclosure = ./Disclosure.dhall let renderOptionalDisclosure = λ(suffix : Text) → λ(x : Optional types.Disclosure) - → Optional/fold + → Prelude.Optional.fold types.Disclosure x (List Text) diff --git a/render/Hilite.dhall b/render/Hilite.dhall index f601e7e..69616c8 100644 --- a/render/Hilite.dhall +++ b/render/Hilite.dhall @@ -1,10 +1,11 @@ let types = ../types.dhall +let Prelude = ../Prelude.dhall in λ(a : Type) → λ(renderTrigger : a → Text) → λ(hilite : types.Hilite a) → let trigger = - Optional/fold + Prelude.Optional.fold a hilite.trigger Text @@ -12,7 +13,7 @@ in λ(a : Type) "" let attributes = - Optional/fold + Prelude.Optional.fold types.Attributes.Type hilite.attributes Text diff --git a/render/MenuColor.dhall b/render/MenuColor.dhall index 63982f6..a92afda 100644 --- a/render/MenuColor.dhall +++ b/render/MenuColor.dhall @@ -1,10 +1,11 @@ let types = ../types.dhall +let Prelude = ../Prelude.dhall in λ(x : types.MenuColor) → let attributes = ./Attributes.dhall x.attributes let suffix = - Optional/fold + Prelude.Optional.fold types.Color x.color Text diff --git a/render/ParanoidConfirmation.dhall b/render/ParanoidConfirmation.dhall index a83805e..7aaec31 100644 --- a/render/ParanoidConfirmation.dhall +++ b/render/ParanoidConfirmation.dhall @@ -5,7 +5,7 @@ let types = ../types.dhall let renderConfirmation = λ(name : Text) → λ(o : Optional Bool) - → Optional/fold + → Prelude.Optional.fold Bool o (List Text) diff --git a/render/Scores.dhall b/render/Scores.dhall index 3111431..c6ae96d 100644 --- a/render/Scores.dhall +++ b/render/Scores.dhall @@ -4,7 +4,7 @@ let types = ../types.dhall in λ(x : types.Scores.Type) → let own = - Optional/fold + Prelude.Optional.fold Bool x.own (List Text) @@ -12,7 +12,7 @@ in λ(x : types.Scores.Type) ([] : List Text) let around = - Optional/fold + Prelude.Optional.fold Natural x.around (List Text) @@ -20,7 +20,7 @@ in λ(x : types.Scores.Type) ([] : List Text) let top = - Optional/fold + Prelude.Optional.fold Natural x.top (List Text)