Skip to content

Commit

Permalink
Upgrade to Dhall 1.25 (#179)
Browse files Browse the repository at this point in the history
* Upgrade to Dhall 1.25

* Sort record fields in golden test output.

Dhall 1.25 has got better at forgetting record field order when we ask
it to.

This will produce better diffability.
  • Loading branch information
ocharles authored and quasicomputational committed Aug 20, 2019
1 parent 0f7304d commit 355ef9d
Show file tree
Hide file tree
Showing 29 changed files with 263 additions and 123 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Next -- [YYYY-MM-DD]

* Use `dhall` version 1.25.

## 1.3.4.0 -- 2019-07-05

* Add compatibility for `optparse-applicative-0.15`.
Expand Down
15 changes: 15 additions & 0 deletions MonadRandom.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ mkDerivation, base, mtl, primitive, random, stdenv, transformers
, transformers-compat
}:
mkDerivation {
pname = "MonadRandom";
version = "0.5.1.1";
sha256 = "abda4a297acf197e664695b839b4fb70f53e240f5420489dc21bcf6103958470";
revision = "3";
editedCabalFile = "0fiblwmwk48d1g9j99qrcg1ak904csgfb86y80d1nl2vr782cq6w";
libraryHaskellDepends = [
base mtl primitive random transformers transformers-compat
];
description = "Random-number generation monad";
license = stdenv.lib.licenses.bsd3;
}
14 changes: 14 additions & 0 deletions base-orphans.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ mkDerivation, base, ghc-prim, hspec, hspec-discover, QuickCheck
, stdenv
}:
mkDerivation {
pname = "base-orphans";
version = "0.8.1";
sha256 = "442bd63aed102e753b2fed15df8ae19f35ee07af26590da63837c523b64a99db";
libraryHaskellDepends = [ base ghc-prim ];
testHaskellDepends = [ base hspec QuickCheck ];
testToolDepends = [ hspec-discover ];
homepage = "https://github.com/haskell-compat/base-orphans#readme";
description = "Backwards-compatible orphan instances for base";
license = stdenv.lib.licenses.mit;
}
12 changes: 6 additions & 6 deletions dhall-to-cabal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ library
bytestring ^>=0.10,
containers ^>=0.5 || ^>=0.6,
contravariant ^>=1.4 || ^>=1.5,
dhall ^>=1.24.0,
dhall ^>=1.25.0,
filepath ^>=1.4,
microlens ^>=0.1.0.0 || ^>=0.2.0.0 || ^>=0.3.0.0 || ^>=0.4.0.0,
text ^>=1.2,
Expand All @@ -92,7 +92,7 @@ executable dhall-to-cabal
Cabal ^>=2.4,
base ^>=4.10 || ^>=4.11 || ^>=4.12,
containers ^>=0.5 || ^>=0.6,
dhall ^>=1.24.0,
dhall ^>=1.25.0,
dhall-to-cabal -any,
directory ^>=1.3.0.2,
filepath ^>=1.4,
Expand All @@ -118,7 +118,7 @@ executable cabal-to-dhall
-fno-warn-name-shadowing
build-depends:
base ^>=4.10 || ^>=4.11 || ^>=4.12,
dhall ^>=1.24.0,
dhall ^>=1.25.0,
bytestring ^>=0.10,
dhall-to-cabal -any,
optparse-applicative ^>=0.13.2 || ^>=0.14 || ^>=0.15,
Expand All @@ -138,7 +138,7 @@ executable dhall-to-cabal-meta
build-depends:
base ^>=4.10 || ^>=4.11 || ^>=4.12,
directory ^>=1.3.0.2,
dhall ^>=1.24.0,
dhall ^>=1.25.0,
dhall-to-cabal -any,
filepath ^>=1.4,
optparse-applicative ^>=0.13.2 || ^>=0.14 || ^>=0.15,
Expand All @@ -159,7 +159,7 @@ test-suite golden-tests
Cabal ^>=2.4,
Diff ^>=0.3.4,
bytestring ^>=0.10,
dhall ^>=1.24.0,
dhall ^>=1.25.0,
dhall-to-cabal -any,
filepath ^>=1.4,
microlens ^>=0.1.0.0 || ^>=0.2.0.0 || ^>=0.3.0.0 || ^>=0.4.0.0,
Expand All @@ -183,7 +183,7 @@ test-suite unit-tests
build-depends:
base ^>=4.10 || ^>=4.11 || ^>=4.12,
Cabal ^>=2.4,
dhall ^>=1.24.0,
dhall ^>=1.25.0,
dhall-to-cabal -any,
tasty ^>=0.11 || ^>=0.12 || ^>=1.0 || ^>=1.1 || ^>=1.2,
tasty-hunit ^>=0.10.0.1,
Expand Down
2 changes: 1 addition & 1 deletion dhall-to-cabal.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let deps =
, directory =
majorVersions "directory" [ v "1.3.0.2" ]
, dhall =
majorVersions "dhall" [ v "1.24.0" ]
majorVersions "dhall" [ v "1.25.0" ]
, dhall-to-cabal =
package "dhall-to-cabal" anyVersion
, filepath =
Expand Down
35 changes: 18 additions & 17 deletions dhall.nix
Original file line number Diff line number Diff line change
@@ -1,40 +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, foldl, haskeline
, contravariant, cryptonite, deepseq, Diff, directory, doctest
, dotgen, either, exceptions, filepath, foldl, gauge, haskeline
, http-client, http-client-tls, http-types, lens-family-core
, megaparsec, memory, mockery, mtl, optparse-applicative, parsers
, prettyprinter, prettyprinter-ansi-terminal, profunctors
, QuickCheck, quickcheck-instances, repline, scientific, serialise
, stdenv, tasty, tasty-hunit, tasty-quickcheck, template-haskell
, text, transformers, transformers-compat, turtle
, unordered-containers, uri-encode, vector
, QuickCheck, quickcheck-instances, repline, scientific, semigroups
, serialise, spoon, stdenv, tasty, tasty-hunit, tasty-quickcheck
, template-haskell, text, th-lift-instances, transformers
, transformers-compat, turtle, unordered-containers, uri-encode
, vector
}:
mkDerivation {
pname = "dhall";
version = "1.24.0";
sha256 = "67ff6ff2bcd3c3fed0a598f8038f62a18676a419f7f7773a07804a5cc89404d8";
version = "1.25.0";
sha256 = "10604f648af61bd5ea784769cfe2ff1518a32e7e4e22615e9cbe6fae1ce91835";
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
cborg cborg-json containers contravariant cryptonite deepseq Diff
directory dotgen either exceptions filepath haskeline http-client
http-client-tls http-types lens-family-core megaparsec memory mtl
optparse-applicative parsers prettyprinter
prettyprinter-ansi-terminal profunctors repline scientific
serialise template-haskell text transformers transformers-compat
unordered-containers uri-encode vector
serialise template-haskell text th-lift-instances transformers
transformers-compat unordered-containers uri-encode vector
];
executableHaskellDepends = [ base ];
testHaskellDepends = [
base bytestring cborg containers deepseq directory doctest filepath
foldl megaparsec mockery prettyprinter QuickCheck
quickcheck-instances serialise tasty tasty-hunit tasty-quickcheck
text transformers turtle vector
foldl lens-family-core megaparsec mockery prettyprinter QuickCheck
quickcheck-instances semigroups serialise spoon tasty tasty-hunit
tasty-quickcheck text transformers turtle vector
];
benchmarkHaskellDepends = [
base bytestring containers criterion directory serialise text
base bytestring containers directory gauge serialise text
];
description = "A configuration language guaranteed to terminate";
license = stdenv.lib.licenses.bsd3;
Expand Down
17 changes: 17 additions & 0 deletions either.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ mkDerivation, base, bifunctors, mtl, profunctors, QuickCheck
, semigroupoids, stdenv, test-framework, test-framework-quickcheck2
}:
mkDerivation {
pname = "either";
version = "5.0.1.1";
sha256 = "0243d51d6a02ecb541e4854a588a9b6219a4690ebcbdb79387dd14ad519cdf27";
libraryHaskellDepends = [
base bifunctors mtl profunctors semigroupoids
];
testHaskellDepends = [
base QuickCheck test-framework test-framework-quickcheck2
];
homepage = "http://github.com/ekmett/either/";
description = "Combinators for working with sums";
license = stdenv.lib.licenses.bsd3;
}
12 changes: 6 additions & 6 deletions golden-tests/cabal-to-dhall/SPDX.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ let prelude = ./../../dhall/prelude.dhall
let types = ./../../dhall/types.dhall

in prelude.defaults.Package
{ name =
"foo"
, version =
prelude.v "0"
, license =
{ license =
types.License.SPDX
( prelude.SPDX.and
( prelude.SPDX.or
Expand All @@ -32,4 +28,8 @@ in prelude.defaults.Package
)
)
)
}
, name =
"foo"
, version =
prelude.v "0"
}
18 changes: 9 additions & 9 deletions golden-tests/cabal-to-dhall/benchmark.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ let prelude = ./../../dhall/prelude.dhall
let types = ./../../dhall/types.dhall

in prelude.defaults.Package
{ name =
"blah"
, version =
prelude.v "1"
, benchmarks =
{ benchmarks =
[ { benchmark =
λ(config : types.Config)
prelude.defaults.Benchmark
{ main-is =
"Main.hs"
, compiler-options =
{ compiler-options =
prelude.defaults.CompilerOptions
{ GHC = [ "-O2" ] : List Text }
, main-is =
"Main.hs"
}
, name =
"fancy-benchmark"
}
]
, cabal-version =
prelude.v "2.0"
}
, name =
"blah"
, version =
prelude.v "1"
}
12 changes: 6 additions & 6 deletions golden-tests/cabal-to-dhall/conditional-dependencies.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ let prelude = ./../../dhall/prelude.dhall
let types = ./../../dhall/types.dhall

in prelude.defaults.Package
{ name =
"Name"
, version =
prelude.v "1"
, cabal-version =
{ cabal-version =
prelude.v "2.0"
, library =
Some
Expand Down Expand Up @@ -62,4 +58,8 @@ in prelude.defaults.Package
)
, license =
types.License.Unspecified
}
, name =
"Name"
, version =
prelude.v "1"
}
12 changes: 6 additions & 6 deletions golden-tests/cabal-to-dhall/executable.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ let prelude = ./../../dhall/prelude.dhall
let types = ./../../dhall/types.dhall

in prelude.defaults.Package
{ name =
"blah"
, version =
prelude.v "1"
, cabal-version =
{ cabal-version =
prelude.v "2.0"
, executables =
[ { executable =
Expand All @@ -17,4 +13,8 @@ in prelude.defaults.Package
"hello"
}
]
}
, name =
"blah"
, version =
prelude.v "1"
}
14 changes: 7 additions & 7 deletions golden-tests/cabal-to-dhall/gh-36.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ let prelude = ./../../dhall/prelude.dhall
let types = ./../../dhall/types.dhall

in prelude.defaults.Package
{ name =
"wai-servlet"
, version =
prelude.v "0.1.5.0"
{ cabal-version =
prelude.v "2.0"
, flags =
[ { default =
False
Expand All @@ -18,8 +16,6 @@ in prelude.defaults.Package
"wai-servlet-debug"
}
]
, cabal-version =
prelude.v "2.0"
, library =
Some
( λ(config : types.Config)
Expand Down Expand Up @@ -173,4 +169,8 @@ in prelude.defaults.Package

else prelude.defaults.Library
)
}
, name =
"wai-servlet"
, version =
prelude.v "0.1.5.0"
}
12 changes: 6 additions & 6 deletions golden-tests/cabal-to-dhall/mixins-no-signatures.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ let prelude = ./../../dhall/prelude.dhall
let types = ./../../dhall/types.dhall

in prelude.defaults.Package
{ name =
"mixins-test"
, version =
prelude.v "0"
, library =
{ library =
Some
( λ(config : types.Config)
prelude.defaults.Library
Expand Down Expand Up @@ -51,4 +47,8 @@ in prelude.defaults.Package
]
}
)
}
, name =
"mixins-test"
, version =
prelude.v "0"
}
12 changes: 6 additions & 6 deletions golden-tests/cabal-to-dhall/otheros.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ let prelude = ./../../dhall/prelude.dhall
let types = ./../../dhall/types.dhall

in prelude.defaults.Package
{ name =
"test"
, version =
prelude.v "0"
, cabal-version =
{ cabal-version =
prelude.v "2.0"
, library =
Some
Expand All @@ -19,4 +15,8 @@ in prelude.defaults.Package

else prelude.defaults.Library { exposed-modules = [ "A" ] }
)
}
, name =
"test"
, version =
prelude.v "0"
}
18 changes: 9 additions & 9 deletions golden-tests/cabal-to-dhall/repotypeunknown.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ let prelude = ./../../dhall/prelude.dhall
let types = ./../../dhall/types.dhall

in prelude.defaults.Package
{ name =
"foo"
, version =
prelude.v "2"
, cabal-version =
{ cabal-version =
prelude.v "2.4"
, name =
"foo"
, source-repos =
[ prelude.defaults.SourceRepo
{ type =
Some types.RepoType.Git
{ kind =
types.RepoKind.RepoKindUnknown { _1 = "blargh" }
, location =
Some "https://example.com"
, kind =
types.RepoKind.RepoKindUnknown { _1 = "blargh" }
, type =
Some types.RepoType.Git
}
]
, version =
prelude.v "2"
}
Loading

0 comments on commit 355ef9d

Please sign in to comment.