diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 507cd7347..8caae6fb7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,6 +34,9 @@ jobs: - os: runner: "ubuntu-latest" stack-yaml: "stack.ghc-9.2.yaml" + - os: + runner: "ubuntu-latest" + stack-yaml: "stack.ghc-9.4.yaml" fail-fast: false name: ${{ matrix.os.runner }} - ${{ matrix.stack-yaml }} runs-on: ${{ matrix.os.runner }} diff --git a/dhall-json/dhall-json.cabal b/dhall-json/dhall-json.cabal index e8d3f2bba..075263e23 100644 --- a/dhall-json/dhall-json.cabal +++ b/dhall-json/dhall-json.cabal @@ -38,7 +38,7 @@ Library Hs-Source-Dirs: src Build-Depends: base >= 4.11.0.0 && < 5 , - aeson >= 1.4.6.0 && < 2.2 , + aeson >= 1.4.6.0 && < 2.3 , aeson-pretty >= 0.8.0 && < 0.9 , aeson-yaml >= 1.1.0 && < 1.2 , bytestring < 0.13, diff --git a/dhall-lsp-server/dhall-lsp-server.cabal b/dhall-lsp-server/dhall-lsp-server.cabal index 4a9fca071..65b28b0d9 100644 --- a/dhall-lsp-server/dhall-lsp-server.cabal +++ b/dhall-lsp-server/dhall-lsp-server.cabal @@ -54,15 +54,15 @@ library , dhall-json >= 1.4 && < 1.8 , filepath >= 1.4.2 && < 1.5 , lsp >= 2.1.0.0 && < 2.2 - , lens >= 4.16.1 && < 5.3 + , lens >= 4.16.1 && < 5.4 -- megaparsec follows SemVer: https://github.com/mrkkrp/megaparsec/issues/469#issuecomment-927918469 , megaparsec >= 7.0.2 && < 10 - , mtl >= 2.2.2 && < 2.3 + , mtl >= 2.2.2 && < 2.4 , network-uri >= 2.6.1.0 && < 2.7 , prettyprinter >= 1.7.0 && < 1.8 , text >= 1.2.3.0 && < 2.1 , text-rope >= 0.2 && < 0.3 - , transformers >= 0.5.5.0 && < 0.6 + , transformers >= 0.5.5.0 && < 0.7 , unordered-containers >= 0.2.9.0 && < 0.3 , uri-encode >= 1.5.0.5 && < 1.6 default-language: Haskell2010 @@ -105,7 +105,7 @@ Test-Suite tests Build-Depends: base , lsp-types >= 2.0.1 && < 2.1 , - hspec >= 2.7 && < 2.11 , + hspec >= 2.7 && < 2.12 , lsp-test >= 0.15.0.0 && < 0.16 , tasty >= 0.11.2 && < 1.5 , tasty-hspec >= 1.1 && < 1.3 , diff --git a/dhall-nixpkgs/dhall-nixpkgs.cabal b/dhall-nixpkgs/dhall-nixpkgs.cabal index 6afaf5335..3cfe447cc 100644 --- a/dhall-nixpkgs/dhall-nixpkgs.cabal +++ b/dhall-nixpkgs/dhall-nixpkgs.cabal @@ -17,7 +17,7 @@ Build-Type: Simple Executable dhall-to-nixpkgs Main-Is: Main.hs Build-Depends: base >= 4.11 && < 5 - , aeson >= 1.0.0.0 && < 2.2 + , aeson >= 1.0.0.0 && < 2.3 , base16-bytestring >= 1.0.0.0 , base64-bytestring >= 1.1.0.0 , bytestring < 0.12 @@ -33,7 +33,7 @@ Executable dhall-to-nixpkgs , optparse-applicative >= 0.14.0.0 && < 0.19 , prettyprinter >= 1.7.0 && < 1.8 , text >= 0.11.1.0 && < 2.1 - , transformers >= 0.2.0.0 && < 0.6 + , transformers >= 0.2.0.0 && < 0.7 , turtle >= 1.6 && < 1.7 , network-uri < 2.8 Default-Language: Haskell2010 diff --git a/dhall/src/Dhall/Import/Headers.hs b/dhall/src/Dhall/Import/Headers.hs index e61f2dcb7..ccebe54cd 100644 --- a/dhall/src/Dhall/Import/Headers.hs +++ b/dhall/src/Dhall/Import/Headers.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ViewPatterns #-} @@ -9,7 +10,12 @@ module Dhall.Import.Headers , toOriginHeaders ) where -import Control.Applicative (Alternative (..), liftA2) +import Control.Applicative + ( Alternative (..) +#if !MIN_VERSION_base(4,18,0) + , liftA2 +#endif + ) import Control.Exception (SomeException) import Control.Monad.Catch (handle, throwM) import Data.Text (Text) diff --git a/dhall/src/Dhall/Marshal/Decode.hs b/dhall/src/Dhall/Marshal/Decode.hs index ab571ad33..0828ecf59 100644 --- a/dhall/src/Dhall/Marshal/Decode.hs +++ b/dhall/src/Dhall/Marshal/Decode.hs @@ -1,5 +1,6 @@ {-# LANGUAGE ApplicativeDo #-} {-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DerivingStrategies #-} @@ -135,7 +136,12 @@ module Dhall.Marshal.Decode ) where -import Control.Applicative (empty, liftA2) +import Control.Applicative + ( empty +#if !MIN_VERSION_base(4,18,0) + , liftA2 +#endif + ) import Control.Exception (Exception) import Control.Monad (guard) import Control.Monad.Trans.State.Strict @@ -1604,14 +1610,15 @@ data ExtractError s a = instance (Pretty s, Pretty a, Typeable s, Typeable a) => Show (ExtractError s a) where show (TypeMismatch e) = show e show (ExpectedTypeError e) = show e - show (ExtractError es) = - _ERROR <> ": Failed extraction \n\ - \ \n\ - \The expression type-checked successfully but the transformation to the target \n\ - \type failed with the following error: \n\ - \ \n\ - \" <> Data.Text.unpack es <> "\n\ - \ \n" + show (ExtractError es) = unlines + [ _ERROR <> ": Failed extraction " + , " " + , "The expression type-checked successfully but the transformation to the target " + , "type failed with the following error: " + , " " + , Data.Text.unpack es + , " " + ] instance (Pretty s, Pretty a, Typeable s, Typeable a) => Exception (ExtractError s a) @@ -1669,24 +1676,22 @@ data InvalidDecoder s a = InvalidDecoder instance (Pretty s, Typeable s, Pretty a, Typeable a) => Exception (InvalidDecoder s a) instance (Pretty s, Pretty a, Typeable s, Typeable a) => Show (InvalidDecoder s a) where - show InvalidDecoder { .. } = - _ERROR <> ": Invalid Dhall.Decoder \n\ - \ \n\ - \Every Decoder must provide an extract function that does not fail with a type \n\ - \error if an expression matches the expected type. You provided a Decoder that \n\ - \disobeys this contract \n\ - \ \n\ - \The Decoder provided has the expected dhall type: \n\ - \ \n\ - \" <> show txt0 <> "\n\ - \ \n\ - \and it threw a type error during extraction from the well-typed expression: \n\ - \ \n\ - \" <> show txt1 <> "\n\ - \ \n" - where - txt0 = Dhall.Util.insert invalidDecoderExpected - txt1 = Dhall.Util.insert invalidDecoderExpression + show InvalidDecoder { .. } = unlines + [ _ERROR <> ": Invalid Dhall.Decoder " + , " " + , "Every Decoder must provide an extract function that does not fail with a type " + , "error if an expression matches the expected type. You provided a Decoder that " + , "disobeys this contract " + , " " + , "The Decoder provided has the expected dhall type: " + , " " + , show (Dhall.Util.insert invalidDecoderExpected) + , " " + , "and it threw a type error during extraction from the well-typed expression: " + , " " + , show (Dhall.Util.insert invalidDecoderExpression) + , " " + ] {-| Useful synonym for the `Validation` type used when marshalling Dhall expressions. diff --git a/dhall/src/Dhall/Parser/Combinators.hs b/dhall/src/Dhall/Parser/Combinators.hs index d0a72e826..0eae40966 100644 --- a/dhall/src/Dhall/Parser/Combinators.hs +++ b/dhall/src/Dhall/Parser/Combinators.hs @@ -23,7 +23,12 @@ module Dhall.Parser.Combinators ) where -import Control.Applicative (Alternative (..), liftA2) +import Control.Applicative + ( Alternative (..) +#if !MIN_VERSION_base(4,18,0) + , liftA2 +#endif + ) import Control.Exception (Exception) import Control.Monad (MonadPlus (..)) import Data.String (IsString (..)) diff --git a/dhall/src/Dhall/Parser/Expression.hs b/dhall/src/Dhall/Parser/Expression.hs index 45459327e..65b22bf8e 100644 --- a/dhall/src/Dhall/Parser/Expression.hs +++ b/dhall/src/Dhall/Parser/Expression.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedLists #-} {-# LANGUAGE OverloadedStrings #-} @@ -7,7 +8,13 @@ -- | Parsing Dhall expressions. module Dhall.Parser.Expression where -import Control.Applicative (Alternative (..), liftA2, optional) +import Control.Applicative + ( Alternative (..) +#if !MIN_VERSION_base(4,18,0) + , liftA2 +#endif + , optional + ) import Data.Foldable (foldl') import Data.List.NonEmpty (NonEmpty (..)) import Data.Text (Text) diff --git a/stack.ghc-9.6.yaml b/stack.ghc-9.6.yaml new file mode 100644 index 000000000..d6a2b3862 --- /dev/null +++ b/stack.ghc-9.6.yaml @@ -0,0 +1,32 @@ +resolver: lts-22.23 +packages: + - dhall + - dhall-bash + - dhall-csv + - dhall-docs + - dhall-json + - dhall-lsp-server + - dhall-nix + - dhall-openapi + - dhall-toml + - dhall-yaml +extra-deps: + - lsp-test-0.15.0.1 + - algebraic-graphs-0.6.1@sha256:b0b0a916a74f9cba3e678cde25e27f045d7b026a8d0f1a55a05e86f2877fdfd2,8807 + - free-5.1.10@sha256:58496bb68e5704be250ddc823622d50b5a3b8bdf0dc4f6539ecfde25bc4ef6e2,5169 + - hnix-0.17.0@sha256:57e172f915d70be2dd88c6377caebe8bd63337123ffef42df49b05dc0b1f168b,19224 + - hnix-store-core-0.6.1.0@sha256:0171c3a571ab263c3e3aa3e6daca15602f2030a6862cb032038017e6d0265898,3882 + - hnix-store-remote-0.6.0.0@sha256:a8ea18bb355164bfd357fac12b0c5d32c95ffd455260f8b6c7fcaeddebf5918c,3270 + - lens-family-th-0.5.3.1@sha256:725700a89f26f790ee7d6630a4fa394ac0305ae8d2cff06c037ee47cb3499654,1700 + - lsp-2.1.0.0@sha256:ef6fc28eac6dc27672cd8471c9f83f14de646a9c1fcaf993a451d2ae4de274e8,3533 + - lsp-types-2.0.2.0@sha256:a9a51c3cea0726d91fe63fa0670935ee720f7b31bc3f3b33b2483fc538152677,29421 + - tomland-1.3.3.2@sha256:8dd15cd2e8178a9bc3c3db4ef53e706e36ee093417a98b1d26131524629c3c07,9483 + - validation-selective-0.2.0.0@sha256:cc847f1a110e3b1bd437a5356f115881b61cafcb11781b570b180efd88bf0907,3917 +nix: + packages: + - ncurses + - zlib +flags: + # https://github.com/RyanGlScott/mintty/issues/4 + mintty: + Win32-2-13-1: false diff --git a/stack.yaml b/stack.yaml index 711b7b0d8..84c85588f 120000 --- a/stack.yaml +++ b/stack.yaml @@ -1 +1 @@ -stack.ghc-9.4.yaml \ No newline at end of file +stack.ghc-9.6.yaml \ No newline at end of file