From d8c5e33f6015e3f17aaf5fd290b1834e6e6c1049 Mon Sep 17 00:00:00 2001 From: Paul Bonaud Date: Thu, 13 Aug 2020 16:01:49 +0200 Subject: [PATCH] dhall: BREAKING CHANGE update dhall config for 1.33+ compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since dhall 1.33.0 lang version the `Optional/fold` function is removed from the language and can be replaced by the usage of the `merge` function which now works on Optional values 🎉 since 1.29 https://github.com/dhall-lang/dhall-haskell/pull/1608 This new code is thus not compatible with versions of dhall <1.29.0 (due to the new feature of the `merge` fonction). --- .travis.yml | 2 +- dhall-1.26.1.nix => dhall-1.34.0.nix | 2 +- .../server/service/plugin/correlationId.dhall | 24 +++++++------------ 3 files changed, 11 insertions(+), 17 deletions(-) rename dhall-1.26.1.nix => dhall-1.34.0.nix (87%) diff --git a/.travis.yml b/.travis.yml index 14ab868..99c10c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ install: # Install ansible - nix-env -i python3 ansible ansible-lint - - nix-env -if ./dhall-1.26.1.nix + - nix-env -if ./dhall-1.34.0.nix # Check ansible version - ansible --version diff --git a/dhall-1.26.1.nix b/dhall-1.34.0.nix similarity index 87% rename from dhall-1.26.1.nix rename to dhall-1.34.0.nix index 918a528..a70d201 100644 --- a/dhall-1.26.1.nix +++ b/dhall-1.34.0.nix @@ -19,4 +19,4 @@ let ''; }; in - mkVersion "1.26.1" "0sl4r3mfairgd6kn26hs1r1lkh8rn992grd73078rhqf5w90ag05" + mkVersion "1.34.0" "0n64jkgbv7a3cmlv3gxpgc11p9b5w0k9nc0zm9am2pzmp6vm6b4n" diff --git a/dhall/server/service/plugin/correlationId.dhall b/dhall/server/service/plugin/correlationId.dhall index d5d5928..41c5720 100644 --- a/dhall/server/service/plugin/correlationId.dhall +++ b/dhall/server/service/plugin/correlationId.dhall @@ -2,22 +2,16 @@ let Plugin = ./Plugin.dhall let config = ./Config.dhall -in λ(generator : Optional Text) - → { name = - "correlation-id" +in λ(generator : Optional Text) → + { name = "correlation-id" , config = config.CorrelationId - { header_name = - "X-correl" - , echo_downstream = - True - , generator = - Optional/fold - Text - generator - Text - (λ(t : Text) → t) - "uuid#counter" - } + { header_name = "X-correl" + , echo_downstream = True + , generator = + merge + { None = "uuid#counter", Some = λ(x : Text) → x } + generator + } } : Plugin -- 2.41.0