Update to Dhall v5.0.0: deprecate constructors keyword (#45)

This commit is contained in:
Fabrizio Ferrai 2019-01-21 08:49:34 +02:00 committed by GitHub
parent 272c10efc4
commit ced5c10af3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 75 additions and 57 deletions

View File

@ -28,12 +28,12 @@ or the [full tutorial][dhall-tutorial].
## Prerequisites
**NOTE**: `dhall-kubernetes` requires at least version `1.18.0` of [the interpreter](https://github.com/dhall-lang/dhall-haskell)
(version `3.0.0` of the language).
**NOTE**: `dhall-kubernetes` requires at least version `1.20.1` of [the interpreter](https://github.com/dhall-lang/dhall-haskell)
(version `5.0.0` of the language).
You can install the latest version with the following:
```bash
stack install dhall-1.18.0 dhall-json-1.2.4 --resolver=nightly-2018-11-12
stack install dhall-1.20.1 dhall-json-1.2.6 --resolver=nightly-2019-01-17
```
## Quickstart - main API
@ -177,7 +177,7 @@ in let Ingress = ../types/io.k8s.api.extensions.v1beta1.Ingress.dhall
in let defaultIngress = ../default/io.k8s.api.extensions.v1beta1.Ingress.dhall
in let defaultMeta = ../default/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta.dhall
in let defaultSpec = ../default/io.k8s.api.extensions.v1beta1.IngressSpec.dhall
in let IntOrString = ../default/io.k8s.apimachinery.pkg.util.intstr.IntOrString.dhall
in let IntOrString = ../types/io.k8s.apimachinery.pkg.util.intstr.IntOrString.dhall
-- Our Service type
in let Service = ./Config.dhall

View File

@ -1,4 +1,4 @@
let intOrString = ../../default/io.k8s.apimachinery.pkg.util.intstr.IntOrString.dhall
let intOrString = ../../types/io.k8s.apimachinery.pkg.util.intstr.IntOrString.dhall
in
{ deployment = ../../default/io.k8s.api.apps.v1.Deployment.dhall
@ -17,7 +17,6 @@ in
, pathVolume = ../../default/io.k8s.api.core.v1.HostPathVolumeSource.dhall
, meta = ../../default/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta.dhall
, selector = ../../default/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector.dhall
, intOrString = intOrString
, Int = intOrString.Int
, String = intOrString.String
}
}

View File

@ -1,4 +1,4 @@
let intOrString = ../../default/io.k8s.apimachinery.pkg.util.intstr.IntOrString.dhall
let intOrString = ../../types/io.k8s.apimachinery.pkg.util.intstr.IntOrString.dhall
in
{ service = ../../default/io.k8s.api.core.v1.Service.dhall
, spec = ../../default/io.k8s.api.core.v1.ServiceSpec.dhall
@ -6,4 +6,4 @@ in
, meta = ../../default/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta.dhall
, Int = intOrString.Int
, String = intOrString.String
}
}

View File

@ -2,5 +2,5 @@
, annotations = [] : List { mapKey : Text, mapValue : Text }
, containerPort = 8080
, outPort = 80
, type = (constructors ./ServiceType).NodePort {=}
}
, type = (./ServiceType).NodePort {=}
}

View File

@ -142,7 +142,7 @@ def main():
typ = build_type(modelSpec, '../types')
# In case we have a union, we make the constructors for it
if typ[0] == '<':
f.write('constructors {}\n'.format(typ))
f.write('{}\n'.format(typ))
# Otherwise we just output the identity
else:
f.write('\(a : {}) -> a\n'.format(typ))

View File

@ -1 +1 @@
constructors < Int : Natural | String : Text >
< Int : Natural | String : Text >

View File

@ -29,12 +29,12 @@ or the [full tutorial][dhall-tutorial].
## Prerequisites
**NOTE**: `dhall-kubernetes` requires at least version `1.18.0` of [the interpreter](https://github.com/dhall-lang/dhall-haskell)
(version `3.0.0` of the language).
**NOTE**: `dhall-kubernetes` requires at least version `1.20.1` of [the interpreter](https://github.com/dhall-lang/dhall-haskell)
(version `5.0.0` of the language).
You can install the latest version with the following:
```bash
stack install dhall-1.18.0 dhall-json-1.2.4 --resolver=nightly-2018-11-12
stack install dhall-1.20.1 dhall-json-1.2.6 --resolver=nightly-2019-01-17
```
## Quickstart - main API

View File

@ -10,7 +10,7 @@ in let Ingress = ../types/io.k8s.api.extensions.v1beta1.Ingress.dhall
in let defaultIngress = ../default/io.k8s.api.extensions.v1beta1.Ingress.dhall
in let defaultMeta = ../default/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta.dhall
in let defaultSpec = ../default/io.k8s.api.extensions.v1beta1.IngressSpec.dhall
in let IntOrString = ../default/io.k8s.apimachinery.pkg.util.intstr.IntOrString.dhall
in let IntOrString = ../types/io.k8s.apimachinery.pkg.util.intstr.IntOrString.dhall
-- Our Service type
in let Service = ./Config.dhall

View File

@ -1,36 +0,0 @@
{ mkDerivation, ansi-terminal, base, bytestring, case-insensitive
, cborg, containers, contravariant, criterion, cryptonite, deepseq
, Diff, directory, doctest, exceptions, filepath, haskeline
, http-client, http-client-tls, lens-family-core, megaparsec
, memory, mockery, mtl, optparse-applicative, parsers
, prettyprinter, prettyprinter-ansi-terminal, QuickCheck
, quickcheck-instances, repline, scientific, serialise, stdenv
, tasty, tasty-hunit, tasty-quickcheck, template-haskell, text
, transformers, unordered-containers, vector
}:
mkDerivation {
pname = "dhall";
version = "1.18.0";
sha256 = "b528ecff4f757fa085f61636ffb8a6eb90c761106d7d20bd735bee48a6abab94";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
ansi-terminal base bytestring case-insensitive cborg containers
contravariant cryptonite Diff directory exceptions filepath
haskeline http-client http-client-tls lens-family-core megaparsec
memory mtl optparse-applicative parsers prettyprinter
prettyprinter-ansi-terminal repline scientific serialise
template-haskell text transformers unordered-containers vector
];
executableHaskellDepends = [ base ];
testHaskellDepends = [
base containers deepseq directory doctest filepath mockery
prettyprinter QuickCheck quickcheck-instances serialise tasty
tasty-hunit tasty-quickcheck text transformers vector
];
benchmarkHaskellDepends = [
base bytestring containers criterion directory serialise text
];
description = "A configuration language guaranteed to terminate";
license = stdenv.lib.licenses.bsd3;
}

41
nix/dhall-1.20.1.nix Normal file
View File

@ -0,0 +1,41 @@
{ mkDerivation, aeson, aeson-pretty, ansi-terminal, base
, bytestring, case-insensitive, cborg, cborg-json, containers
, contravariant, criterion, cryptonite, deepseq, Diff, directory
, doctest, dotgen, exceptions, filepath, haskeline, http-client
, http-client-tls, http-types, lens-family-core, megaparsec, memory
, mockery, mtl, optparse-applicative, parsers, prettyprinter
, prettyprinter-ansi-terminal, QuickCheck, quickcheck-instances
, repline, scientific, serialise, stdenv, tasty, tasty-hunit
, tasty-quickcheck, template-haskell, text, transformers
, unordered-containers, uri-encode, vector
}:
mkDerivation {
pname = "dhall";
version = "1.20.1";
sha256 = "e077e8f4945484db4e35e8ae422e9eabac1b155972602f0404d818e3e185bcdc";
revision = "1";
editedCabalFile = "1km0zbbahhq24s84s9gcck1javhplqjg51q4qf8i19iahnxkl3rq";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson aeson-pretty ansi-terminal base bytestring case-insensitive
cborg cborg-json containers contravariant cryptonite Diff directory
dotgen exceptions filepath haskeline http-client http-client-tls
http-types lens-family-core megaparsec memory mtl
optparse-applicative parsers prettyprinter
prettyprinter-ansi-terminal repline scientific serialise
template-haskell text transformers unordered-containers uri-encode
vector
];
executableHaskellDepends = [ base ];
testHaskellDepends = [
base containers deepseq directory doctest filepath mockery
prettyprinter QuickCheck quickcheck-instances serialise tasty
tasty-hunit tasty-quickcheck text transformers vector
];
benchmarkHaskellDepends = [
base bytestring containers criterion directory serialise text
];
description = "A configuration language guaranteed to terminate";
license = stdenv.lib.licenses.bsd3;
}

View File

@ -4,8 +4,8 @@
}:
mkDerivation {
pname = "dhall-json";
version = "1.2.4";
sha256 = "e594b47a168c47225d929d94c8dce12b9b32a195c9faa02ff091b3f18adb63e7";
version = "1.2.6";
sha256 = "9989a705a780ccc8b40f242e5dcb8949ade590a0180ae9559bffa25d829d2838";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [

13
nix/dhall-text-1.0.15.nix Normal file
View File

@ -0,0 +1,13 @@
{ mkDerivation, base, dhall, optparse-applicative, stdenv, text }:
mkDerivation {
pname = "dhall-text";
version = "1.0.15";
sha256 = "afa2dd0cbb6d261b5cf79988f673cf2405f5419c306c55181d9aae3ec6c932b2";
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
base dhall optparse-applicative text
];
description = "Template text using Dhall";
license = stdenv.lib.licenses.bsd3;
}

View File

@ -11,8 +11,9 @@ let
packageOverrides = pkgs: rec {
haskellPackages = pkgs.haskellPackages.override {
overrides = haskellPackagesNew: haskellPackagesOld: rec {
dhall = haskellPackagesNew.callPackage ./nix/dhall-1.18.0.nix {};
dhall-json = haskellPackagesNew.callPackage ./nix/dhall-json-1.2.4.nix {};
dhall = haskellPackagesNew.callPackage ./nix/dhall-1.20.1.nix {};
dhall-json = haskellPackagesNew.callPackage ./nix/dhall-json-1.2.6.nix {};
dhall-text = haskellPackagesNew.callPackage ./nix/dhall-text-1.0.15.nix {};
megaparsec = haskellPackagesNew.callPackage ./nix/megaparsec-7.0.2.nix {};
repline = haskellPackagesNew.callPackage ./nix/repline-0.2.0.0.nix {};
};