diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0dfb586e..10256f7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,11 +17,11 @@ jobs: matrix: runner: - os: macos-14 # macos sonoma on m1; 3 vcpu, 7 GB memory - base-nixpkgs-channel: nixpkgs-24.05-darwin + base-nixpkgs-channel: nixpkgs-24.11-darwin - os: ubuntu-22.04 # linux x86_64; 4 vcpu, 16 GB memory - base-nixpkgs-channel: nixos-24.05 + base-nixpkgs-channel: nixos-24.11 ghc: - - ghc-9-6 + - ghc-9-8 runs-on: ${{ matrix.runner.os }} steps: - name: Install Nix diff --git a/nix/common-haskell-overrides.nix b/nix/common-haskell-overrides.nix index 72c146cd..4a09c0a7 100644 --- a/nix/common-haskell-overrides.nix +++ b/nix/common-haskell-overrides.nix @@ -8,8 +8,10 @@ self: super: brick = pkgs.haskell.lib.doJailbreak (self.callHackage "brick" "0.71.1" { }); - # >= 5.39 has breaking changes for brick@0.71.1; pin to 5.38 (known-good) - vty = self.callHackage "vty" "5.38" { }; + # >= 5.39 has breaking changes for brick@0.71.1; pin to 5.38 (known-good). + # jailbreak to allow deepseq 1.5.1.0 as provided by ghc 9.8.3 + vty = + pkgs.haskell.lib.doJailbreak (self.callHackage "vty" "5.38" { }); # latest master supports ghc 9.4.x tasty-test-reporter = packageFromSources "tasty-test-reporter"; @@ -23,6 +25,6 @@ self: super: # servant-auth-server 0.4.8.0 is marked as broken in nixpkgs but it should be fine servant-auth-server = pkgs.haskell.lib.markUnbroken super.servant-auth-server; - # for now, pin hw-kafka-client to 4.0.3; nixpkgs@release-24.05 provides 5.3.0 + # for now, pin hw-kafka-client to 4.0.3; nixpkgs@release-24.11 provides 5.3.0 hw-kafka-client = self.callHackage "hw-kafka-client" "4.0.3" { }; } \ No newline at end of file diff --git a/nix/mk-shell.nix b/nix/mk-shell.nix index 429a8943..f8530bf4 100644 --- a/nix/mk-shell.nix +++ b/nix/mk-shell.nix @@ -2,8 +2,6 @@ # Fix from https://github.com/srid/haskell-template let - sources = import ./sources.nix { }; - pkgs-unstable = import sources.nixpkgs-unstable { }; workaround140774 = hpkg: with pkgs.haskell.lib; overrideCabal hpkg (drv: { enableSeparateBinOutput = false; }); @@ -74,6 +72,6 @@ in pkgs.mkShell { pkgs.postgresql # for nri-postgres pkgs.redis # for nri-redis pkgs.zlib - pkgs-unstable.zookeeper # for nri-kafka + pkgs.zookeeper # for nri-kafka ]; } diff --git a/nix/sources.json b/nix/sources.json index 588c66ab..bb3c46c5 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -12,27 +12,15 @@ "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs": { - "branch": "release-24.05", + "branch": "release-24.11", "description": "Nix Packages collection", "homepage": "", "owner": "NixOS", "repo": "nixpkgs", - "rev": "59be168c1fcab339bab5fd482d93c995f470cbad", - "sha256": "0am4h3ck2as4lq7b37zlxah8zqm57scjl06y5xkk9islh3jvklmf", + "rev": "2bc8d3dcc2eb6f7d23590b52042e274eda02318e", + "sha256": "0lj7ynnhqc9j9h100xw4bdggz7q730iwvzad8fcr0l1wz2n72lxp", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/59be168c1fcab339bab5fd482d93c995f470cbad.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "nixpkgs-unstable": { - "branch": "nixpkgs-unstable", - "description": "Nix Packages collection", - "homepage": "", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "4c0834929cafb7478a5e82616d484578a80a3e41", - "sha256": "1ld29fsviq5ax1drh25fxqcxi44g3cisf5hfib29d0qxjqlicbdf", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/4c0834929cafb7478a5e82616d484578a80a3e41.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/2bc8d3dcc2eb6f7d23590b52042e274eda02318e.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "string-qq": { diff --git a/nri-env-parser/CHANGELOG.md b/nri-env-parser/CHANGELOG.md index b695667f..f65c6ac7 100644 --- a/nri-env-parser/CHANGELOG.md +++ b/nri-env-parser/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.3.0.0 + +- Drop support for GHC 9.2.x +- Support GHC 9.8.3, `text-2.1.x` + # 0.2.0.1 - Drop support for `aeson-1.x` diff --git a/nri-env-parser/nri-env-parser.cabal b/nri-env-parser/nri-env-parser.cabal index 9d368cd2..f88613fe 100644 --- a/nri-env-parser/nri-env-parser.cabal +++ b/nri-env-parser/nri-env-parser.cabal @@ -1,11 +1,11 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.36.0. +-- This file has been generated from package.yaml by hpack version 0.36.1. -- -- see: https://github.com/sol/hpack name: nri-env-parser -version: 0.2.0.1 +version: 0.3.0.0 synopsis: Read environment variables as settings to build 12-factor apps. description: Please see the README at . category: Web @@ -50,11 +50,11 @@ library TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin build-depends: - base >=4.16.4.0 && <4.19 + base >=4.17 && <4.20 , modern-uri >=0.3.1.0 && <0.4 , network-uri >=2.6.2.0 && <2.8 , nri-prelude >=0.1.0.0 && <0.7 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 default-language: Haskell2010 test-suite tests @@ -83,9 +83,9 @@ test-suite tests ExtendedDefaultRules ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -fno-warn-type-defaults build-depends: - base >=4.16.4.0 && <4.19 + base >=4.17 && <4.20 , modern-uri >=0.3.1.0 && <0.4 , network-uri >=2.6.2.0 && <2.8 , nri-prelude >=0.1.0.0 && <0.7 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 default-language: Haskell2010 diff --git a/nri-env-parser/package.yaml b/nri-env-parser/package.yaml index 9bbc1ab4..67f8c80a 100644 --- a/nri-env-parser/package.yaml +++ b/nri-env-parser/package.yaml @@ -3,7 +3,7 @@ synopsis: Read environment variables as settings to build 12-factor apps. description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-env-parser#readme author: NoRedInk -version: 0.2.0.1 +version: 0.3.0.0 maintainer: haskell-open-source@noredink.com copyright: 2024 NoRedInk Corp. github: NoRedInk/haskell-libraries/env-parser @@ -15,11 +15,11 @@ extra-doc-files: - CHANGELOG.md library: dependencies: &dependencies - - base >= 4.16.4.0 && < 4.19 + - base >= 4.17 && < 4.20 - nri-prelude >= 0.1.0.0 && < 0.7 - modern-uri >= 0.3.1.0 && < 0.4 - network-uri >= 2.6.2.0 && < 2.8 - - text >= 1.2.3.1 && < 2.1 + - text >= 1.2.3.1 && < 2.2 exposed-modules: - Environment source-dirs: src diff --git a/nri-env-parser/src/Environment.hs b/nri-env-parser/src/Environment.hs index 8277d234..6f9bc4d0 100644 --- a/nri-env-parser/src/Environment.hs +++ b/nri-env-parser/src/Environment.hs @@ -221,7 +221,7 @@ instance Applicative Decoder where } where readFromEnvironment' :: - Semigroup err => + (Semigroup err) => (env -> Result err (a -> config)) -> (env -> Result err a) -> env -> diff --git a/nri-http/CHANGELOG.md b/nri-http/CHANGELOG.md index b228c029..f4395d67 100644 --- a/nri-http/CHANGELOG.md +++ b/nri-http/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.6.0.0 + +- Drop support for GHC 9.2.x +- Support GHC 9.8.3, `bytestring-0.12.x.x`, `text-2.1.x`, `aeson-2.2.x.x` + # 0.5.0.3 - Use an `MVar` instead of `IORef` for mocked requests to hopefully reduce flake in cases where concurrent (mocked) requests are being made diff --git a/nri-http/nri-http.cabal b/nri-http/nri-http.cabal index 3d77139a..98348b36 100644 --- a/nri-http/nri-http.cabal +++ b/nri-http/nri-http.cabal @@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.36.0. +-- This file has been generated from package.yaml by hpack version 0.36.1. -- -- see: https://github.com/sol/hpack name: nri-http -version: 0.5.0.3 +version: 0.6.0.0 synopsis: Make Elm style HTTP requests description: Please see the README at . category: Web @@ -54,9 +54,9 @@ library NumericUnderscores ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin build-depends: - aeson >=2.0 && <2.2 - , base >=4.16.4.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + aeson >=2.0 && <2.3 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , case-insensitive >=1.1 && <2.0 , conduit >=1.3.0 && <1.4 , http-client >=0.6.0 && <0.8 @@ -64,10 +64,10 @@ library , http-types ==0.12.* , mime-types >=0.1.0.0 && <0.2 , network-uri >=2.6.0.0 && <2.8 - , nri-observability >=0.1.0.0 && <0.3 + , nri-observability >=0.1.0.0 && <0.4 , nri-prelude >=0.1.0.0 && <0.7 , safe-exceptions >=0.1.7.0 && <1.3 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 default-language: Haskell2010 test-suite spec @@ -100,9 +100,9 @@ test-suite spec NumericUnderscores ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin -fno-warn-type-defaults build-depends: - aeson >=2.0 && <2.2 - , base >=4.12.0.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + aeson >=2.0 && <2.3 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , case-insensitive >=1.1 && <2.0 , conduit >=1.3.0 && <1.4 , http-client >=0.6.0 && <0.8 @@ -110,10 +110,10 @@ test-suite spec , http-types ==0.12.* , mime-types >=0.1.0.0 && <0.2 , network-uri >=2.6.0.0 && <2.8 - , nri-observability >=0.1.0.0 && <0.2 + , nri-observability >=0.1.0.0 && <0.4 , nri-prelude >=0.1.0.0 && <0.7 , safe-exceptions >=0.1.7.0 && <1.3 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 , wai >=3.2.0 && <3.3 , warp >=3.3.0 && <3.4 default-language: Haskell2010 diff --git a/nri-http/package.yaml b/nri-http/package.yaml index ca024d2e..22f5f97a 100644 --- a/nri-http/package.yaml +++ b/nri-http/package.yaml @@ -2,7 +2,7 @@ name: nri-http synopsis: Make Elm style HTTP requests description: Please see the README at . author: NoRedInk -version: 0.5.0.3 +version: 0.6.0.0 maintainer: haskell-open-source@noredink.com copyright: 2024 NoRedInk Corp. github: NoRedInk/haskell-libraries/nri-http @@ -14,11 +14,11 @@ extra-source-files: - "test/golden-results-*/*" library: dependencies: - - aeson >= 2.0 && < 2.2 - - base >= 4.16.4.0 && < 4.19 - - bytestring >= 0.10.8.2 && < 0.12 + - aeson >= 2.0 && < 2.3 + - base >= 4.17 && < 4.20 + - bytestring >= 0.10.8.2 && < 0.13 - nri-prelude >= 0.1.0.0 && < 0.7 - - nri-observability >= 0.1.0.0 && < 0.3 + - nri-observability >= 0.1.0.0 && < 0.4 - conduit >= 1.3.0 && < 1.4 - case-insensitive >= 1.1 && < 2.0 - http-client >= 0.6.0 && < 0.8 @@ -27,7 +27,7 @@ library: - mime-types >= 0.1.0.0 && < 0.2 - network-uri >= 2.6.0.0 && < 2.8 - safe-exceptions >= 0.1.7.0 && < 1.3 - - text >= 1.2.3.1 && < 2.1 + - text >= 1.2.3.1 && < 2.2 exposed-modules: - Http - Http.Mock @@ -35,11 +35,11 @@ library: tests: spec: dependencies: - - aeson >= 2.0 && < 2.2 - - base >= 4.12.0.0 && < 4.19 - - bytestring >= 0.10.8.2 && < 0.12 + - aeson >= 2.0 && < 2.3 + - base >= 4.17 && < 4.20 + - bytestring >= 0.10.8.2 && < 0.13 - nri-prelude >= 0.1.0.0 && < 0.7 - - nri-observability >= 0.1.0.0 && < 0.2 + - nri-observability >= 0.1.0.0 && < 0.4 - conduit >= 1.3.0 && < 1.4 - case-insensitive >= 1.1 && < 2.0 - http-client >= 0.6.0 && < 0.8 @@ -48,7 +48,7 @@ tests: - mime-types >= 0.1.0.0 && < 0.2 - network-uri >= 2.6.0.0 && < 2.8 - safe-exceptions >= 0.1.7.0 && < 1.3 - - text >= 1.2.3.1 && < 2.1 + - text >= 1.2.3.1 && < 2.2 - wai >= 3.2.0 && < 3.3 - warp >= 3.3.0 && < 3.4 main: Main.hs diff --git a/nri-http/src/Http.hs b/nri-http/src/Http.hs index 0eec8211..008ce720 100644 --- a/nri-http/src/Http.hs +++ b/nri-http/src/Http.hs @@ -167,7 +167,7 @@ stringBody mimeType text = -- | Put some JSON value in the body of your Request. This will automatically -- add the Content-Type: application/json header. -jsonBody :: Aeson.ToJSON body => body -> Body +jsonBody :: (Aeson.ToJSON body) => body -> Body jsonBody json = Internal.Body { Internal.bodyContents = Aeson.encode json, @@ -325,7 +325,7 @@ mkMetadata response = -- | -- Expect the response body to be JSON. -expectJson :: Aeson.FromJSON a => Expect a +expectJson :: (Aeson.FromJSON a) => Expect a expectJson = Internal.ExpectJson -- | diff --git a/nri-http/src/Http/Internal.hs b/nri-http/src/Http/Internal.hs index ca4b01e8..8731b22b 100644 --- a/nri-http/src/Http/Internal.hs +++ b/nri-http/src/Http/Internal.hs @@ -55,7 +55,7 @@ type Expect a = Expect' Error a -- | Logic for interpreting a response body. data Expect' x a where - ExpectJson :: Aeson.FromJSON a => Expect a + ExpectJson :: (Aeson.FromJSON a) => Expect a ExpectText :: Expect Text ExpectWhatever :: Expect () ExpectTextResponse :: (Response Text -> Result x a) -> Expect' x a diff --git a/nri-http/src/Http/Mock.hs b/nri-http/src/Http/Mock.hs index 091da7de..09dcec0a 100644 --- a/nri-http/src/Http/Mock.hs +++ b/nri-http/src/Http/Mock.hs @@ -113,7 +113,7 @@ getTextBody req = -- submitted inside a 'stub' function. -- -- This will return an error if parsing the JSON body fails. -getJsonBody :: Aeson.FromJSON a => Internal.Request' e expect -> Result Text a +getJsonBody :: (Aeson.FromJSON a) => Internal.Request' e expect -> Result Text a getJsonBody req = case Aeson.eitherDecodeStrict (getBytesBody req) of Prelude.Left err -> Err (Text.fromList err) @@ -178,7 +178,7 @@ tryRespond (Stub respond : rest) req = |> Maybe.andThen Dynamic.fromDynamic |> Maybe.withDefault (tryRespond rest req) -printType :: Dynamic.Typeable expect => proxy expect -> Text +printType :: (Dynamic.Typeable expect) => proxy expect -> Text printType expect = Type.Reflection.someTypeRep expect |> Debug.toString diff --git a/nri-http/test/GoldenHelpers.hs b/nri-http/test/GoldenHelpers.hs index cb0c0a4e..b49d88ef 100644 --- a/nri-http/test/GoldenHelpers.hs +++ b/nri-http/test/GoldenHelpers.hs @@ -11,13 +11,12 @@ module GoldenHelpers (goldenResultsDir) where -- > foo -- > bar -- > baz --- +-- -- In GHC 8.10.x (and possibly GHC 9.0.x?) `srcLocEndLine` and `srcLocEndCol` -- would correspond to the `z` at the end of `baz`. Unfortunately, in GHC 9.2.x -- it corresponds to the second `o` at the end of `foo`. -- -- We keep this helper around so that if this happens again for future GHC versions -- we can have different golden results for different GHC versions as necessary. - goldenResultsDir :: Text -goldenResultsDir = "test/golden-results-9.2" +goldenResultsDir = "test/golden-results-9.8" diff --git a/nri-http/test/Main.hs b/nri-http/test/Main.hs index 1ff8bd7a..8453b0d4 100644 --- a/nri-http/test/Main.hs +++ b/nri-http/test/Main.hs @@ -211,7 +211,7 @@ withServerIO log app run = do -- immediately returns that request so you can run expectations against it. -- -- Useful if you want to check properties of requests you send. -expectRequest :: Show e => (Http.Handler -> Text -> Task e a) -> Expect.Expectation' Wai.Request +expectRequest :: (Show e) => (Http.Handler -> Text -> Task e a) -> Expect.Expectation' Wai.Request expectRequest run = do let app req _respond = Exception.throwIO (FirstRequest req) log <- Expect.succeeds Platform.logHandler @@ -226,7 +226,7 @@ newtype FirstRequest = FirstRequest Wai.Request deriving (Show) instance Exception.Exception FirstRequest -spanForTask :: Show e => Task e () -> Expect.Expectation' Platform.TracingSpan +spanForTask :: (Show e) => Task e () -> Expect.Expectation' Platform.TracingSpan spanForTask task = do spanVar <- Expect.fromIO MVar.newEmptyMVar res <- diff --git a/nri-http/test/golden-results-9.2/expected-http-span b/nri-http/test/golden-results-9.8/expected-http-span similarity index 86% rename from nri-http/test/golden-results-9.2/expected-http-span rename to nri-http/test/golden-results-9.8/expected-http-span index 8c574bb8..f0edbe99 100644 --- a/nri-http/test/golden-results-9.2/expected-http-span +++ b/nri-http/test/golden-results-9.8/expected-http-span @@ -6,7 +6,7 @@ TracingSpan Just ( "rootTracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-http-0.6.0.0-inplace-spec" , srcLocModule = "Main" , srcLocFile = "test/Main.hs" , srcLocStartLine = 234 @@ -29,12 +29,12 @@ TracingSpan Just ( "tracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-http-0.6.0.0-inplace-spec" , srcLocModule = "Http" , srcLocFile = "src/Http.hs" - , srcLocStartLine = 434 + , srcLocStartLine = 433 , srcLocStartCol = 11 - , srcLocEndLine = 434 + , srcLocEndLine = 433 , srcLocEndCol = 33 } ) diff --git a/nri-kafka/CHANGELOG.md b/nri-kafka/CHANGELOG.md index c41c51ac..632474d3 100644 --- a/nri-kafka/CHANGELOG.md +++ b/nri-kafka/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.3.0.0 + +- Drop support for GHC 9.2.x +- Support GHC 9.8.3, `bytestring-0.12.x.x`, `text-2.1.x`, `aeson-2.2.x.x` + # 0.2.0.1 - Drop support for `aeson-1.x` diff --git a/nri-kafka/nri-kafka.cabal b/nri-kafka/nri-kafka.cabal index dc27f18d..bd12ec2f 100644 --- a/nri-kafka/nri-kafka.cabal +++ b/nri-kafka/nri-kafka.cabal @@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.36.0. +-- This file has been generated from package.yaml by hpack version 0.36.1. -- -- see: https://github.com/sol/hpack name: nri-kafka -version: 0.2.0.1 +version: 0.3.0.0 synopsis: Functions for working with Kafka description: Please see the README at . category: Web @@ -67,19 +67,19 @@ library TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fno-warn-type-defaults -fplugin=NriPrelude.Plugin build-depends: - aeson >=2.0 && <2.2 + aeson >=2.0 && <2.3 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , conduit >=1.3.0 && <1.4 , containers >=0.6.0.1 && <0.7 , hw-kafka-client >=4.0.3 && <5.0 - , nri-env-parser >=0.1.0.0 && <0.3 - , nri-observability >=0.1.1.1 && <0.3 + , nri-env-parser >=0.1.0.0 && <0.4 + , nri-observability >=0.1.1.1 && <0.4 , nri-prelude >=0.1.0.0 && <0.7 , safe-exceptions >=0.1.7.0 && <1.3 , stm >=2.4 && <2.6 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 , time >=1.8.0.2 && <2 , unix >=2.7.2.2 && <2.9 , uuid >=1.3.0 && <1.4 @@ -111,20 +111,20 @@ executable pause-resume-bug-consumer TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fno-warn-type-defaults -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -O2 -main-is Consumer build-depends: - aeson >=2.0 && <2.2 + aeson >=2.0 && <2.3 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , conduit >=1.3.0 && <1.4 , containers >=0.6.0.1 && <0.7 , hw-kafka-client >=4.0.3 && <5.0 - , nri-env-parser >=0.1.0.0 && <0.3 + , nri-env-parser >=0.1.0.0 && <0.4 , nri-kafka - , nri-observability >=0.1.1.1 && <0.3 + , nri-observability >=0.1.1.1 && <0.4 , nri-prelude >=0.1.0.0 && <0.7 , safe-exceptions >=0.1.7.0 && <1.3 , stm >=2.4 && <2.6 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 , time >=1.8.0.2 && <2 , unix >=2.7.2.2 && <2.9 , uuid >=1.3.0 && <1.4 @@ -160,20 +160,20 @@ executable pause-resume-bug-producer TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fno-warn-type-defaults -fplugin=NriPrelude.Plugin -main-is Producer build-depends: - aeson >=2.0 && <2.2 + aeson >=2.0 && <2.3 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , conduit >=1.3.0 && <1.4 , containers >=0.6.0.1 && <0.7 , hw-kafka-client >=4.0.3 && <5.0 - , nri-env-parser >=0.1.0.0 && <0.3 + , nri-env-parser >=0.1.0.0 && <0.4 , nri-kafka - , nri-observability >=0.1.1.1 && <0.3 + , nri-observability >=0.1.1.1 && <0.4 , nri-prelude >=0.1.0.0 && <0.7 , safe-exceptions >=0.1.7.0 && <1.3 , stm >=2.4 && <2.6 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 , time >=1.8.0.2 && <2 , unix >=2.7.2.2 && <2.9 , uuid >=1.3.0 && <1.4 @@ -224,19 +224,19 @@ test-suite tests TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fno-warn-type-defaults -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -fno-warn-type-defaults build-depends: - aeson >=2.0 && <2.2 + aeson >=2.0 && <2.3 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , conduit >=1.3.0 && <1.4 , containers >=0.6.0.1 && <0.7 , hw-kafka-client >=4.0.3 && <5.0 - , nri-env-parser >=0.1.0.0 && <0.3 - , nri-observability >=0.1.1.1 && <0.3 + , nri-env-parser >=0.1.0.0 && <0.4 + , nri-observability >=0.1.1.1 && <0.4 , nri-prelude >=0.1.0.0 && <0.7 , safe-exceptions >=0.1.7.0 && <1.3 , stm >=2.4 && <2.6 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 , time >=1.8.0.2 && <2 , unix >=2.7.2.2 && <2.9 , uuid >=1.3.0 && <1.4 diff --git a/nri-kafka/package.yaml b/nri-kafka/package.yaml index ca448d0f..772625ff 100644 --- a/nri-kafka/package.yaml +++ b/nri-kafka/package.yaml @@ -3,7 +3,7 @@ synopsis: Functions for working with Kafka description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-kafka#readme author: NoRedInk -version: 0.2.0.1 +version: 0.3.0.0 maintainer: haskell-open-source@noredink.com copyright: 2024 NoRedInk Corp. github: NoRedInk/haskell-libraries/nri-kafka @@ -14,19 +14,19 @@ extra-source-files: - LICENSE - CHANGELOG.md dependencies: - - aeson >= 2.0 && < 2.2 + - aeson >= 2.0 && < 2.3 - async >=2.2.2 && <2.3 - - base >= 4.16.4.0 && < 4.19 - - bytestring >= 0.10.8.2 && < 0.12 + - base >= 4.17 && < 4.20 + - bytestring >= 0.10.8.2 && < 0.13 - conduit >= 1.3.0 && < 1.4 - containers >= 0.6.0.1 && < 0.7 - hw-kafka-client >=4.0.3 && < 5.0 - - nri-env-parser >= 0.1.0.0 && < 0.3 - - nri-observability >= 0.1.1.1 && < 0.3 + - nri-env-parser >= 0.1.0.0 && < 0.4 + - nri-observability >= 0.1.1.1 && < 0.4 - nri-prelude >= 0.1.0.0 && < 0.7 - safe-exceptions >= 0.1.7.0 && < 1.3 - stm >= 2.4 && < 2.6 - - text >= 1.2.3.1 && < 2.1 + - text >= 1.2.3.1 && < 2.2 - time >= 1.8.0.2 && < 2 - unix >= 2.7.2.2 && < 2.9 - uuid >=1.3.0 && < 1.4 diff --git a/nri-kafka/src/Kafka/Test.hs b/nri-kafka/src/Kafka/Test.hs index 5303b0f8..4d472eab 100644 --- a/nri-kafka/src/Kafka/Test.hs +++ b/nri-kafka/src/Kafka/Test.hs @@ -15,7 +15,7 @@ import qualified Platform -- yields a mock Kafka handler, and returns an expectation wrapping a list of -- messages that would have been written if the handler was real stub :: - Stack.HasCallStack => + (Stack.HasCallStack) => (Internal.Handler -> Expect.Expectation) -> Expect.Expectation' (List Kafka.Msg) stub stubbed = do diff --git a/nri-kafka/src/Kafka/Worker/Fetcher.hs b/nri-kafka/src/Kafka/Worker/Fetcher.hs index 273b6b99..d474d3ca 100644 --- a/nri-kafka/src/Kafka/Worker/Fetcher.hs +++ b/nri-kafka/src/Kafka/Worker/Fetcher.hs @@ -208,7 +208,7 @@ throttle (Settings.ThrottleAt maxMsgsPerSecondPerPartition) maxPollIntervalMs ne then Control.Concurrent.threadDelay microSecondsToSleep else Prelude.pure () -groupDictAndMap :: Ord b => (a -> (b, c)) -> List a -> Dict.Dict b (List c) +groupDictAndMap :: (Ord b) => (a -> (b, c)) -> List a -> Dict.Dict b (List c) groupDictAndMap f = List.foldr ( \x -> diff --git a/nri-log-explorer/CHANGELOG.md b/nri-log-explorer/CHANGELOG.md index 1504becb..b12d771e 100644 --- a/nri-log-explorer/CHANGELOG.md +++ b/nri-log-explorer/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.3.0.0 + +- Drop support for GHC 9.2.x +- Support GHC 9.8.3, `bytestring-0.12.x.x`, `text-2.1.x`, `aeson-2.2.x.x` + # 0.2.0.1 - Drop support for `aeson-1.x` diff --git a/nri-log-explorer/nri-log-explorer.cabal b/nri-log-explorer/nri-log-explorer.cabal index 267e174f..1a6a8f6f 100644 --- a/nri-log-explorer/nri-log-explorer.cabal +++ b/nri-log-explorer/nri-log-explorer.cabal @@ -1,11 +1,11 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.36.0. +-- This file has been generated from package.yaml by hpack version 0.36.1. -- -- see: https://github.com/sol/hpack name: nri-log-explorer -version: 0.2.0.1 +version: 0.3.0.0 synopsis: Explore logs produced by nri-prelude tests. description: Please see the README at . category: Web @@ -49,12 +49,12 @@ executable log-explorer TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -threaded -rtsopts "-with-rtsopts=-N -T -xq10m" -O2 -fplugin=NriPrelude.Plugin build-depends: - aeson >=2.0 && <2.2 + aeson >=2.0 && <2.3 , aeson-pretty >=0.8.0 && <0.9 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.19 + , base >=4.17 && <4.20 , brick >=0.51 && <0.72 - , bytestring >=0.10.8.2 && <0.12 + , bytestring >=0.10.8.2 && <0.13 , directory >=1.3.3.0 && <1.4 , fuzzy >=0.1.0.0 && <0.2 , io-streams >=1.5.0.0 && <1.6 @@ -63,7 +63,7 @@ executable log-explorer , pcre-light >=0.4.1.0 && <0.4.2 , process >=1.6.0.0 && <1.7 , safe-exceptions >=0.1.7.0 && <1.3 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 , text-zipper >=0.10.1 && <0.14 , time >=1.8.0.2 && <2 , unordered-containers >=0.2.0.0 && <0.3 diff --git a/nri-log-explorer/package.yaml b/nri-log-explorer/package.yaml index c9153a30..75203173 100644 --- a/nri-log-explorer/package.yaml +++ b/nri-log-explorer/package.yaml @@ -3,7 +3,7 @@ synopsis: Explore logs produced by nri-prelude tests. description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-log-explorer#readme author: NoRedInk -version: 0.2.0.1 +version: 0.3.0.0 maintainer: haskell-open-source@noredink.com copyright: 2024 NoRedInk Corp. github: NoRedInk/haskell-libraries @@ -16,12 +16,12 @@ extra-doc-files: executables: log-explorer: dependencies: - - aeson >= 2.0 && < 2.2 + - aeson >= 2.0 && < 2.3 - aeson-pretty >= 0.8.0 && < 0.9 - async >= 2.2.2 && < 2.3 - - base >= 4.16.4.0 && < 4.19 + - base >= 4.17 && < 4.20 - brick >= 0.51 && < 0.72 - - bytestring >= 0.10.8.2 && < 0.12 + - bytestring >= 0.10.8.2 && < 0.13 - directory >= 1.3.3.0 && < 1.4 - fuzzy >= 0.1.0.0 && < 0.2 - io-streams >= 1.5.0.0 && < 1.6 @@ -31,7 +31,7 @@ executables: - nri-prelude >= 0.1.0.0 && < 0.7 - process >= 1.6.0.0 && < 1.7 - safe-exceptions >= 0.1.7.0 && < 1.3 - - text >= 1.2.3.1 && < 2.1 + - text >= 1.2.3.1 && < 2.2 - text-zipper >= 0.10.1 && < 0.14 - time >= 1.8.0.2 && < 2 - vector >= 0.12.1.2 && < 0.14 diff --git a/nri-log-explorer/src/Main.hs b/nri-log-explorer/src/Main.hs index a4104ff8..cb4974d4 100644 --- a/nri-log-explorer/src/Main.hs +++ b/nri-log-explorer/src/Main.hs @@ -602,7 +602,8 @@ annotateSearch maybeEditor span = case maybeEditor of Nothing -> (NoMatch, span) Just editor -> - if getEditContents editor /= "" + if getEditContents editor + /= "" && Text.contains (Data.Text.toCaseFold <| getEditContents editor) (Data.Text.toCaseFold <| rawSummary (original span)) @@ -1022,7 +1023,8 @@ viewSpanDetails Span {original} = Just summary -> viewDetail "summary" summary, viewDetail "duration" - ( ( Platform.finished original - Platform.started original + ( ( Platform.finished original + - Platform.started original |> Platform.inMicroseconds |> Prelude.fromIntegral |> (\n -> n `Prelude.div` 1000) diff --git a/nri-observability/CHANGELOG.md b/nri-observability/CHANGELOG.md index 0ed54ddb..bec8b5f2 100644 --- a/nri-observability/CHANGELOG.md +++ b/nri-observability/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.3.0.0 + +- Drop support for GHC 9.2.x +- Support GHC 9.8.3, `bytestring-0.12.x.x`, `text-2.1.x`, `aeson-2.2.x.x` + # 0.2.0.1 - Drop support for `aeson-1.x` diff --git a/nri-observability/nri-observability.cabal b/nri-observability/nri-observability.cabal index eb9ce53c..b7a01767 100644 --- a/nri-observability/nri-observability.cabal +++ b/nri-observability/nri-observability.cabal @@ -1,11 +1,11 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.36.0. +-- This file has been generated from package.yaml by hpack version 0.36.1. -- -- see: https://github.com/sol/hpack name: nri-observability -version: 0.2.0.1 +version: 0.3.0.0 synopsis: Report log spans collected by nri-prelude. description: Please see the README at . category: Web @@ -65,23 +65,23 @@ library TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin build-depends: - aeson >=2.0 && <2.2 + aeson >=2.0 && <2.3 , aeson-pretty >=0.8.0 && <0.9 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.19 + , base >=4.17 && <4.20 , bugsnag-hs >=0.1.0.0 && <0.3 - , bytestring >=0.10.8.2 && <0.12 + , bytestring >=0.10.8.2 && <0.13 , conduit >=1.3.0 && <1.4 , directory >=1.3.3.0 && <1.4 , hostname ==1.0.* , http-client >=0.6.0 && <0.8 , http-client-tls >=0.3.0 && <0.4 - , nri-env-parser >=0.1.0.0 && <0.3 + , nri-env-parser >=0.1.0.0 && <0.4 , nri-prelude >=0.1.0.0 && <0.7 , random >=1.1 && <1.3 , safe-exceptions >=0.1.7.0 && <1.3 , stm >=2.4 && <2.6 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 , time >=1.8.0.2 && <2 , unordered-containers >=0.2.0.0 && <0.3 , uuid >=1.3.0 && <1.4 @@ -134,23 +134,23 @@ test-suite tests ExtendedDefaultRules ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -fno-warn-type-defaults build-depends: - aeson >=2.0 && <2.2 + aeson >=2.0 && <2.3 , aeson-pretty >=0.8.0 && <0.9 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.19 + , base >=4.17 && <4.20 , bugsnag-hs >=0.1.0.0 && <0.3 - , bytestring >=0.10.8.2 && <0.12 + , bytestring >=0.10.8.2 && <0.13 , conduit >=1.3.0 && <1.4 , directory >=1.3.3.0 && <1.4 , hostname ==1.0.* , http-client >=0.6.0 && <0.8 , http-client-tls >=0.3.0 && <0.4 - , nri-env-parser >=0.1.0.0 && <0.3 + , nri-env-parser >=0.1.0.0 && <0.4 , nri-prelude >=0.1.0.0 && <0.7 , random >=1.1 && <1.3 , safe-exceptions >=0.1.7.0 && <1.3 , stm >=2.4 && <2.6 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 , time >=1.8.0.2 && <2 , unordered-containers >=0.2.0.0 && <0.3 , uuid >=1.3.0 && <1.4 diff --git a/nri-observability/package.yaml b/nri-observability/package.yaml index fe3b18ee..e9d7e7e1 100644 --- a/nri-observability/package.yaml +++ b/nri-observability/package.yaml @@ -3,7 +3,7 @@ synopsis: Report log spans collected by nri-prelude. description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-observability#readme author: NoRedInk -version: 0.2.0.1 +version: 0.3.0.0 maintainer: haskell-open-source@noredink.com copyright: 2024 NoRedInk Corp. github: NoRedInk/haskell-libraries/observability @@ -14,24 +14,24 @@ extra-doc-files: - LICENSE - CHANGELOG.md dependencies: - - aeson >= 2.0 && < 2.2 + - aeson >= 2.0 && < 2.3 - aeson-pretty >= 0.8.0 && < 0.9 - async >= 2.2.2 && < 2.3 - - base >= 4.16.4.0 && < 4.19 + - base >= 4.17 && < 4.20 - bugsnag-hs >= 0.1.0.0 && < 0.3 - - bytestring >= 0.10.8.2 && < 0.12 + - bytestring >= 0.10.8.2 && < 0.13 - conduit >= 1.3.0 && < 1.4 - directory >= 1.3.3.0 && < 1.4 - http-client >= 0.6.0 && < 0.8 - http-client-tls >= 0.3.0 && < 0.4 - hostname >= 1.0 && < 1.1 - - nri-env-parser >= 0.1.0.0 && < 0.3 + - nri-env-parser >= 0.1.0.0 && < 0.4 - nri-prelude >= 0.1.0.0 && < 0.7 - random >= 1.1 && < 1.3 - unordered-containers >= 0.2.0.0 && < 0.3 - safe-exceptions >= 0.1.7.0 && < 1.3 - stm >= 2.4 && < 2.6 - - text >= 1.2.3.1 && < 2.1 + - text >= 1.2.3.1 && < 2.2 - time >= 1.8.0.2 && < 2 - uuid >=1.3.0 && < 1.4 library: diff --git a/nri-observability/src/Log/Kafka.hs b/nri-observability/src/Log/Kafka.hs index e0e5e8cb..e805519b 100644 --- a/nri-observability/src/Log/Kafka.hs +++ b/nri-observability/src/Log/Kafka.hs @@ -121,5 +121,5 @@ instance Aeson.ToJSON Contents where -- > instance Aeson.ToJSON MyMessagePayload -- > -- > contents = mkContents MyMessagePayload { counter = 5 } -mkContents :: Aeson.ToJSON a => a -> Contents +mkContents :: (Aeson.ToJSON a) => a -> Contents mkContents = Contents diff --git a/nri-observability/src/Platform/ReporterHelpers.hs b/nri-observability/src/Platform/ReporterHelpers.hs index 2e3b3bbb..725e021b 100644 --- a/nri-observability/src/Platform/ReporterHelpers.hs +++ b/nri-observability/src/Platform/ReporterHelpers.hs @@ -28,7 +28,7 @@ import qualified Prelude -- , ("treasure.coords.y", "14" ) -- , ("treasure.worth" , "Tons!") -- ] -toHashMap :: Aeson.ToJSON a => a -> HashMap.HashMap Text Text +toHashMap :: (Aeson.ToJSON a) => a -> HashMap.HashMap Text Text toHashMap x = case Aeson.toJSON x of Aeson.Object object -> diff --git a/nri-observability/src/Reporter/Bugsnag/Internal.hs b/nri-observability/src/Reporter/Bugsnag/Internal.hs index 6701ec01..22e04e30 100644 --- a/nri-observability/src/Reporter/Bugsnag/Internal.hs +++ b/nri-observability/src/Reporter/Bugsnag/Internal.hs @@ -275,7 +275,9 @@ doBreadcrumb timer span = case Platform.frame span of Nothing -> Nothing Just (_, frame) -> - Stack.srcLocFile frame ++ ":" ++ Prelude.show (Stack.srcLocStartLine frame) + Stack.srcLocFile frame + ++ ":" + ++ Prelude.show (Stack.srcLocStartLine frame) |> Text.fromList |> HashMap.singleton "stack frame" |> Just @@ -465,7 +467,7 @@ toStackFrame functionName frame = Bugsnag.stackFrame_inProject = Just True } -typeName :: forall a. Typeable.Typeable a => a -> Text +typeName :: forall a. (Typeable.Typeable a) => a -> Text typeName _ = Typeable.typeRep (Proxy.Proxy :: Proxy.Proxy a) |> Prelude.show diff --git a/nri-observability/src/Reporter/Honeycomb/Internal.hs b/nri-observability/src/Reporter/Honeycomb/Internal.hs index 7e0a65f7..f5329b6a 100644 --- a/nri-observability/src/Reporter/Honeycomb/Internal.hs +++ b/nri-observability/src/Reporter/Honeycomb/Internal.hs @@ -137,7 +137,8 @@ deriveSampleRate rootSpan settings = -- https://www.wolframalpha.com/input/?i=plot+1%2Fmax%281%2F1000%2C+min%281%2C+%281%2F1000%29+*+%281.5+%5E+%28x+%2F+30%29%29%29%29+from+x%3D1+to+x%3D300 sampleRateForDuration :: Float -> Float -> Float -> Float sampleRateForDuration baseRate requestDurationMs apdexTMs = - baseRate * (1.5 ^ (requestDurationMs / apdexTMs)) + baseRate + * (1.5 ^ (requestDurationMs / apdexTMs)) |> clamp baseRate 1 calculateApdex :: Settings -> Platform.TracingSpan -> Float @@ -443,7 +444,7 @@ newtype Span = Span (Dict.Dict Text JsonEncodable) deriving (Aeson.ToJSON, Show) data JsonEncodable where - JsonEncodable :: Aeson.ToJSON a => a -> JsonEncodable + JsonEncodable :: (Aeson.ToJSON a) => a -> JsonEncodable instance Aeson.ToJSON JsonEncodable where toEncoding (JsonEncodable x) = Aeson.toEncoding x @@ -455,7 +456,7 @@ instance Show JsonEncodable where emptySpan :: Span emptySpan = Span Dict.empty -addField :: Aeson.ToJSON a => Text -> a -> Span -> Span +addField :: (Aeson.ToJSON a) => Text -> a -> Span -> Span addField key val (Span span) = Span (Dict.insert key (JsonEncodable val) span) newtype SpanId = SpanId Text diff --git a/nri-postgresql/CHANGELOG.md b/nri-postgresql/CHANGELOG.md index ab577b40..300e82d6 100644 --- a/nri-postgresql/CHANGELOG.md +++ b/nri-postgresql/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.3.0.0 + +- Drop support for GHC 9.2.x +- Support GHC 9.8.3, `bytestring-0.12.x.x`, `text-2.1.x`, `template-haskell-2.21.x.x` + # 0.2.0.1 - Drop support for `aeson-1.x` diff --git a/nri-postgresql/nri-postgresql.cabal b/nri-postgresql/nri-postgresql.cabal index ef845f35..d83724b2 100644 --- a/nri-postgresql/nri-postgresql.cabal +++ b/nri-postgresql/nri-postgresql.cabal @@ -1,11 +1,11 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.36.0. +-- This file has been generated from package.yaml by hpack version 0.36.1. -- -- see: https://github.com/sol/hpack name: nri-postgresql -version: 0.2.0.1 +version: 0.3.0.0 synopsis: Make queries against Postgresql. description: Please see the README at . category: Web @@ -62,19 +62,19 @@ library ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin build-depends: attoparsec >=0.13.0.0 && <0.15 - , base >=4.16.4.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , filepath >=1.4.2.1 && <1.5 , network >=3.1.0.0 && <3.2 - , nri-env-parser >=0.1.0.0 && <0.3 - , nri-observability >=0.1.0.0 && <0.3 + , nri-env-parser >=0.1.0.0 && <0.4 + , nri-observability >=0.1.0.0 && <0.4 , nri-prelude >=0.1.0.0 && <0.7 , postgresql-typed ==0.6.* , resource-pool >=0.2.0.0 && <0.5 , resourcet >=1.2.0 && <1.4 , safe-exceptions >=0.1.7.0 && <1.3 - , template-haskell >=2.15.0.0 && <2.21 - , text >=1.2.3.1 && <2.1 + , template-haskell >=2.15.0.0 && <2.22 + , text >=1.2.3.1 && <2.2 , time >=1.8.0.2 && <2 default-language: Haskell2010 @@ -120,19 +120,19 @@ test-suite tests ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -fno-warn-type-defaults build-depends: attoparsec >=0.13.0.0 && <0.15 - , base >=4.16.4.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , filepath >=1.4.2.1 && <1.5 , network >=3.1.0.0 && <3.2 - , nri-env-parser >=0.1.0.0 && <0.3 - , nri-observability >=0.1.0.0 && <0.3 + , nri-env-parser >=0.1.0.0 && <0.4 + , nri-observability >=0.1.0.0 && <0.4 , nri-prelude >=0.1.0.0 && <0.7 , postgresql-typed ==0.6.* , resource-pool >=0.2.0.0 && <0.5 , resourcet >=1.2.0 && <1.4 , safe-exceptions >=0.1.7.0 && <1.3 - , template-haskell >=2.15.0.0 && <2.21 - , text >=1.2.3.1 && <2.1 + , template-haskell >=2.15.0.0 && <2.22 + , text >=1.2.3.1 && <2.2 , th-test-utils , time >=1.8.0.2 && <2 default-language: Haskell2010 diff --git a/nri-postgresql/package.yaml b/nri-postgresql/package.yaml index fb606285..25862050 100644 --- a/nri-postgresql/package.yaml +++ b/nri-postgresql/package.yaml @@ -3,7 +3,7 @@ synopsis: Make queries against Postgresql. description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-postgresql#readme author: NoRedInk -version: 0.2.0.1 +version: 0.3.0.0 maintainer: haskell-open-source@noredink.com copyright: 2024 NoRedInk Corp. github: NoRedInk/haskell-libraries/postgresql @@ -17,19 +17,19 @@ extra-source-files: - "test/golden-results/*" dependencies: - attoparsec >= 0.13.0.0 && < 0.15 - - base >= 4.16.4.0 && < 4.19 - - bytestring >= 0.10.8.2 && < 0.12 + - base >= 4.17 && < 4.20 + - bytestring >= 0.10.8.2 && < 0.13 - filepath >= 1.4.2.1 && < 1.5 - network >= 3.1.0.0 && < 3.2 - - nri-env-parser >= 0.1.0.0 && < 0.3 - - nri-observability >= 0.1.0.0 && < 0.3 + - nri-env-parser >= 0.1.0.0 && < 0.4 + - nri-observability >= 0.1.0.0 && < 0.4 - nri-prelude >= 0.1.0.0 && < 0.7 - postgresql-typed >= 0.6 && < 0.7 - resource-pool >= 0.2.0.0 && < 0.5 - resourcet >= 1.2.0 && < 1.4 - safe-exceptions >= 0.1.7.0 && < 1.3 - - template-haskell >= 2.15.0.0 && < 2.21 - - text >= 1.2.3.1 && < 2.1 + - template-haskell >= 2.15.0.0 && < 2.22 + - text >= 1.2.3.1 && < 2.2 - time >= 1.8.0.2 && < 2 default-extensions: - DataKinds diff --git a/nri-postgresql/src/Postgres.hs b/nri-postgresql/src/Postgres.hs index 76f40eb5..24cc719a 100644 --- a/nri-postgresql/src/Postgres.hs +++ b/nri-postgresql/src/Postgres.hs @@ -122,7 +122,7 @@ rollbackAllSafe conn c = -- > Err err -> Task.fail err -- > ) doQuery :: - HasCallStack => + (HasCallStack) => Connection -> Query.Query row -> (Result Query.Error [row] -> Task e a) -> @@ -249,8 +249,8 @@ doIO conn io = Platform.doAnything (Connection.doAnything conn) (io |> map Ok) -- useful typeclass instances -instance PGTypes.PGType "jsonb" => PGTypes.PGType "jsonb[]" where +instance (PGTypes.PGType "jsonb") => PGTypes.PGType "jsonb[]" where type PGVal "jsonb[]" = PGArray.PGArray (PGTypes.PGVal "jsonb") -instance PGTypes.PGType "jsonb" => PGArray.PGArrayType "jsonb[]" where +instance (PGTypes.PGType "jsonb") => PGArray.PGArrayType "jsonb[]" where type PGElemType "jsonb[]" = "jsonb" diff --git a/nri-postgresql/src/Postgres/Settings.hs b/nri-postgresql/src/Postgres/Settings.hs index af9f532f..09b0c847 100644 --- a/nri-postgresql/src/Postgres/Settings.hs +++ b/nri-postgresql/src/Postgres/Settings.hs @@ -318,9 +318,11 @@ toPGDatabase -- https://www.postgresql.org/docs/9.6/libpq-connect.html#LIBPQ-CONNECT-HOST if Text.startsWith "/" host then - Text.toList host ".s.PGSQL." ++ show port - |> SockAddrUnix - |> Right + Text.toList host + ".s.PGSQL." + ++ show port + |> SockAddrUnix + |> Right else Left (Text.toList host, show port) } where diff --git a/nri-postgresql/src/Postgres/Test.hs b/nri-postgresql/src/Postgres/Test.hs index 04569470..81e4c65e 100644 --- a/nri-postgresql/src/Postgres/Test.hs +++ b/nri-postgresql/src/Postgres/Test.hs @@ -24,7 +24,7 @@ import qualified Prelude -- Postgres.Test.test "My Postgres test" <| \Postgres -> do -- -- test stuff! test :: - Stack.HasCallStack => + (Stack.HasCallStack) => Text -> (Postgres.Connection -> Expect.Expectation) -> Test.Test diff --git a/nri-postgresql/test/ObservabilitySpec.hs b/nri-postgresql/test/ObservabilitySpec.hs index 46b4f94b..00cc2881 100644 --- a/nri-postgresql/test/ObservabilitySpec.hs +++ b/nri-postgresql/test/ObservabilitySpec.hs @@ -46,7 +46,7 @@ tests postgres = "test/golden-results/observability-spec-postgres-reporting-ghc-9" ] -spanForTask :: Show e => Task e () -> Expect.Expectation' Platform.TracingSpan +spanForTask :: (Show e) => Task e () -> Expect.Expectation' Platform.TracingSpan spanForTask task = Expect.fromIO <| do spanVar <- MVar.newEmptyMVar diff --git a/nri-postgresql/test/golden-results/observability-spec-postgres-reporting-ghc-9 b/nri-postgresql/test/golden-results/observability-spec-postgres-reporting-ghc-9 index b2a4b18b..4065af65 100644 --- a/nri-postgresql/test/golden-results/observability-spec-postgres-reporting-ghc-9 +++ b/nri-postgresql/test/golden-results/observability-spec-postgres-reporting-ghc-9 @@ -6,7 +6,7 @@ TracingSpan Just ( "rootTracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-postgresql-0.3.0.0-inplace-tests" , srcLocModule = "ObservabilitySpec" , srcLocFile = "test/ObservabilitySpec.hs" , srcLocStartLine = 54 @@ -29,7 +29,7 @@ TracingSpan Just ( "doQuery" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-postgresql-0.3.0.0-inplace-tests" , srcLocModule = "ObservabilitySpec" , srcLocFile = "test/ObservabilitySpec.hs" , srcLocStartLine = 35 @@ -54,7 +54,7 @@ TracingSpan Just ( "withContext" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-postgresql-0.3.0.0-inplace-tests" , srcLocModule = "Postgres" , srcLocFile = "src/Postgres.hs" , srcLocStartLine = 225 diff --git a/nri-prelude/CHANGELOG.md b/nri-prelude/CHANGELOG.md index bbc58f90..7b428ce8 100644 --- a/nri-prelude/CHANGELOG.md +++ b/nri-prelude/CHANGELOG.md @@ -1,7 +1,7 @@ # Unreleased -- Drop support for GHC 8.10.7, `aeson-1.x` -- Support GHC 9.6.5 +- Drop support for GHC 8.10.7, GHC 9.2.x `aeson-1.x` +- Support GHC 9.6.5, GHC 9.8.3, `bytestring-0.12.x.x`, `text-2.1.x`, `aeson-2.2.x.x` - Allow specifying where devlogs for log-explorer go through `NRI_DEV_LOG` environment variable. - Added `putText` and `putTextLn` functions for thread-safe console printing. - Allow `hedgehog-1.4.x` diff --git a/nri-prelude/nri-prelude.cabal b/nri-prelude/nri-prelude.cabal index 0bf89162..73ab1ef9 100644 --- a/nri-prelude/nri-prelude.cabal +++ b/nri-prelude/nri-prelude.cabal @@ -1,6 +1,6 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.36.0. +-- This file has been generated from package.yaml by hpack version 0.36.1. -- -- see: https://github.com/sol/hpack @@ -86,18 +86,18 @@ library TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.3 , aeson-pretty >=0.8.0 && <0.9 , async >=2.2.2 && <2.3 , attoparsec >=0.13.0.0 && <0.15 , auto-update >=0.1.6 && <0.2 - , base >=4.16.4.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , containers >=0.6.0.1 && <0.7 , directory >=1.3.3.0 && <1.4 , exceptions >=0.10.4 && <0.11 , filepath >=1.4.2.1 && <1.5 - , ghc >=8.6.1 && <9.8 + , ghc >=8.6.1 && <9.10 , hedgehog >=1.0.2 && <1.5 , junit-xml >=0.1.0.0 && <0.2.0.0 , lens >=4.16.1 && <5.3 @@ -107,7 +107,7 @@ library , safe-coloured-text-terminfo >=0.0.0.0 && <0.2 , safe-exceptions >=0.1.7.0 && <1.3 , terminal-size >=0.3.2.1 && <0.4 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 , time >=1.8.0.2 && <2 , unix >=2.7.2.2 && <2.9 , vector >=0.12.1.2 && <0.14 @@ -184,18 +184,18 @@ test-suite tests ExtendedDefaultRules ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -threaded -rtsopts "-with-rtsopts=-N -T" -fno-warn-type-defaults build-depends: - aeson >=1.4.6.0 && <2.2 + aeson >=2.0 && <2.3 , aeson-pretty >=0.8.0 && <0.9 , async >=2.2.2 && <2.3 , attoparsec >=0.13.0.0 && <0.15 , auto-update >=0.1.6 && <0.2 - , base >=4.16.4.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , containers >=0.6.0.1 && <0.7 , directory >=1.3.3.0 && <1.4 , exceptions >=0.10.4 && <0.11 , filepath >=1.4.2.1 && <1.5 - , ghc >=8.6.1 && <9.8 + , ghc >=8.6.1 && <9.10 , hedgehog >=1.0.2 && <1.5 , junit-xml >=0.1.0.0 && <0.2.0.0 , lens >=4.16.1 && <5.3 @@ -205,7 +205,7 @@ test-suite tests , safe-coloured-text-terminfo >=0.0.0.0 && <0.2 , safe-exceptions >=0.1.7.0 && <1.3 , terminal-size >=0.3.2.1 && <0.4 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 , time >=1.8.0.2 && <2 , unix >=2.7.2.2 && <2.9 , vector >=0.12.1.2 && <0.14 diff --git a/nri-prelude/package.yaml b/nri-prelude/package.yaml index d661fa4e..f1f5e7e1 100644 --- a/nri-prelude/package.yaml +++ b/nri-prelude/package.yaml @@ -17,18 +17,18 @@ extra-doc-files: - licenses/ELM_TEST_LICENSE library: dependencies: &dependencies - - aeson >= 2.0 && < 2.2 + - aeson >= 2.0 && < 2.3 - aeson-pretty >= 0.8.0 && < 0.9 - async >= 2.2.2 && < 2.3 - attoparsec >= 0.13.0.0 && < 0.15 - auto-update >= 0.1.6 && < 0.2 - - base >= 4.16.4.0 && < 4.19 - - bytestring >= 0.10.8.2 && < 0.12 + - base >= 4.17 && < 4.20 + - bytestring >= 0.10.8.2 && < 0.13 - containers >= 0.6.0.1 && < 0.7 - directory >= 1.3.3.0 && < 1.4 - exceptions >= 0.10.4 && < 0.11 - filepath >= 1.4.2.1 && < 1.5 - - ghc >= 8.6.1 && < 9.8 + - ghc >= 8.6.1 && < 9.10 - hedgehog >= 1.0.2 && < 1.5 - junit-xml >= 0.1.0.0 && < 0.2.0.0 - lens >=4.16.1 && <5.3 @@ -38,7 +38,7 @@ library: - safe-coloured-text-terminfo >= 0.0.0.0 && < 0.2 - safe-exceptions >= 0.1.7.0 && < 1.3 - terminal-size >= 0.3.2.1 && < 0.4 - - text >= 1.2.3.1 && < 2.1 + - text >= 1.2.3.1 && < 2.2 - time >= 1.8.0.2 && < 2 - unix >= 2.7.2.2 && < 2.9 - vector >= 0.12.1.2 && < 0.14 diff --git a/nri-prelude/src/Array.hs b/nri-prelude/src/Array.hs index 80d2efb8..4470d2f0 100644 --- a/nri-prelude/src/Array.hs +++ b/nri-prelude/src/Array.hs @@ -95,8 +95,8 @@ length = -- > initialize 4 (always 0) == fromList [0,0,0,0] initialize :: Int -> (Int -> a) -> Array a initialize n f = - Array - <| Data.Vector.generate + Array <| + Data.Vector.generate (Prelude.fromIntegral n) (Prelude.fromIntegral >> f) @@ -108,8 +108,8 @@ initialize n f = -- Notice that @repeat 3 x@ is the same as @initialize 3 (always x)@. repeat :: Int -> a -> Array a repeat n e = - Array - <| Data.Vector.replicate (Prelude.fromIntegral n) e + Array <| + Data.Vector.replicate (Prelude.fromIntegral n) e -- | Create an array from a 'List'. fromList :: List a -> Array a diff --git a/nri-prelude/src/Basics.hs b/nri-prelude/src/Basics.hs index b492aebf..2cf5fc03 100644 --- a/nri-prelude/src/Basics.hs +++ b/nri-prelude/src/Basics.hs @@ -196,21 +196,21 @@ type Float = Prelude.Double -- to be sure exactly what type of number you are dealing with. When you try to -- /infer/ these conversions (as Scala does) it can be even more confusing. Elm -- has opted for a design that makes all conversions explicit. -(+) :: Prelude.Num number => number -> number -> number +(+) :: (Prelude.Num number) => number -> number -> number (+) = (Prelude.+) -- | Subtract numbers like @4 - 3 == 1@. -- -- See @'(+)'@ for docs on the @number@ type variable. -(-) :: Prelude.Num number => number -> number -> number +(-) :: (Prelude.Num number) => number -> number -> number (-) = (Prelude.-) -- | Multiply numbers like @2 * 3 == 6@. -- -- See @'(+)'@ for docs on the @number@ type variable. -(*) :: Prelude.Num number => number -> number -> number +(*) :: (Prelude.Num number) => number -> number -> number (*) = (Prelude.*) @@ -317,7 +317,7 @@ truncate = -- Breaking from Elm, this relies on Haskell's @Eq@ typeclass. For example: -- -- > data Foo = Bar | Baz deriving (Eq) -(==) :: Prelude.Eq a => a -> a -> Bool +(==) :: (Prelude.Eq a) => a -> a -> Bool (==) = (Prelude.==) @@ -326,23 +326,23 @@ truncate = -- Like with @(==)@, this relies on Haskell's @Eq@ typeclass. -- -- So @(a /= b)@ is the same as @(not (a == b))@. -(/=) :: Prelude.Eq a => a -> a -> Bool +(/=) :: (Prelude.Eq a) => a -> a -> Bool (/=) = (Prelude./=) -(<) :: Prelude.Ord comparable => comparable -> comparable -> Bool +(<) :: (Prelude.Ord comparable) => comparable -> comparable -> Bool (<) = (Prelude.<) -(>) :: Prelude.Ord comparable => comparable -> comparable -> Bool +(>) :: (Prelude.Ord comparable) => comparable -> comparable -> Bool (>) = (Prelude.>) -(<=) :: Prelude.Ord comparable => comparable -> comparable -> Bool +(<=) :: (Prelude.Ord comparable) => comparable -> comparable -> Bool (<=) = (Prelude.<=) -(>=) :: Prelude.Ord comparable => comparable -> comparable -> Bool +(>=) :: (Prelude.Ord comparable) => comparable -> comparable -> Bool (>=) = (Prelude.>=) @@ -350,7 +350,7 @@ truncate = -- -- > max 42 12345678 == 12345678 -- > max "abc" "xyz" == "xyz" -max :: Prelude.Ord comparable => comparable -> comparable -> comparable +max :: (Prelude.Ord comparable) => comparable -> comparable -> comparable max = Prelude.max @@ -358,7 +358,7 @@ max = -- -- > min 42 12345678 == 42 -- > min "abc" "xyz" == "abc" -min :: Prelude.Ord comparable => comparable -> comparable -> comparable +min :: (Prelude.Ord comparable) => comparable -> comparable -> comparable min = Prelude.min @@ -369,7 +369,7 @@ min = -- > compare 3 4 == LT -- > compare 4 4 == EQ -- > compare 5 4 == GT -compare :: Prelude.Ord comparable => comparable -> comparable -> Order +compare :: (Prelude.Ord comparable) => comparable -> comparable -> Order compare = Prelude.compare @@ -424,7 +424,7 @@ xor = -- -- > "hello" ++ "world" == "helloworld" -- > [1,1,2] ++ [3,5,8] == [1,1,2,3,5,8] -(++) :: Prelude.Semigroup appendable => appendable -> appendable -> appendable +(++) :: (Prelude.Semigroup appendable) => appendable -> appendable -> appendable (++) = (Prelude.<>) @@ -462,7 +462,7 @@ remainderBy = -- negate 42 == -42 -- negate -42 == 42 -- negate 0 == 0 -negate :: Prelude.Num number => number -> number +negate :: (Prelude.Num number) => number -> number negate = Prelude.negate @@ -473,7 +473,7 @@ negate = -- > abs -4 == 4 -- > abs -8.5 == 8.5 -- > abs 3.14 == 3.14 -abs :: Prelude.Num number => number -> number +abs :: (Prelude.Num number) => number -> number abs = Prelude.abs @@ -483,7 +483,7 @@ abs = -- > 100 if x < 100 -- > x if 100 <= x < 200 -- > 200 if 200 <= x -clamp :: Prelude.Ord number => number -> number -> number -> number +clamp :: (Prelude.Ord number) => number -> number -> number -> number clamp low high number | number < low = low | number > high = high diff --git a/nri-prelude/src/Debug.hs b/nri-prelude/src/Debug.hs index 4854ce15..4f9e7939 100644 --- a/nri-prelude/src/Debug.hs +++ b/nri-prelude/src/Debug.hs @@ -27,7 +27,7 @@ import Prelude (Show, error) -- down to the value's @Show@ instance, but for strings this typically escapes -- characters. If you say @toString "he said, \\"hi\\""@ it will show @"he said, -- \\"hi\\""@ rather than @he said, "hi"@. -toString :: Show a => a -> Text +toString :: (Show a) => a -> Text toString = Text.Show.Pretty.ppShow >> pack @@ -38,7 +38,7 @@ toString = -- -- It is often possible to sprinkle this around to see if values are what you -- expect. It is kind of old-school to do it this way, but it works! -log :: Show a => Text -> a -> a +log :: (Show a) => Text -> a -> a log message value = Debug.Trace.trace (unpack (concat [message, ": ", toString value])) value @@ -62,6 +62,6 @@ log message value = -- -- When you call this it throws an exception with the message you give. That -- exception is catchable... but don't. -todo :: Stack.HasCallStack => Text -> a +todo :: (Stack.HasCallStack) => Text -> a todo = Stack.withFrozenCallStack (unpack >> error) diff --git a/nri-prelude/src/Dict.hs b/nri-prelude/src/Dict.hs index 063a33a6..780e9bed 100644 --- a/nri-prelude/src/Dict.hs +++ b/nri-prelude/src/Dict.hs @@ -86,12 +86,12 @@ empty = -- > get "Tom" animals == Just Cat -- > get "Jerry" animals == Just Mouse -- > get "Spike" animals == Nothing -get :: Ord comparable => comparable -> Dict comparable v -> Maybe v +get :: (Ord comparable) => comparable -> Dict comparable v -> Maybe v get = Data.Map.Strict.lookup -- | Determine if a key is in a dictionary. -member :: Ord comparable => comparable -> Dict comparable v -> Bool +member :: (Ord comparable) => comparable -> Dict comparable v -> Bool member = Data.Map.Strict.member @@ -109,18 +109,18 @@ isEmpty = -- | Insert a key-value pair into a dictionary. Replaces value when there is -- a collision. -insert :: Ord comparable => comparable -> v -> Dict comparable v -> Dict comparable v +insert :: (Ord comparable) => comparable -> v -> Dict comparable v -> Dict comparable v insert = Data.Map.Strict.insert -- | Remove a key-value pair from a dictionary. If the key is not found, -- no changes are made. -remove :: Ord comparable => comparable -> Dict comparable v -> Dict comparable v +remove :: (Ord comparable) => comparable -> Dict comparable v -> Dict comparable v remove = Data.Map.Strict.delete -- | Update the value of a dictionary for a specific key with a given function. -update :: Ord comparable => comparable -> (Maybe v -> Maybe v) -> Dict comparable v -> Dict comparable v +update :: (Ord comparable) => comparable -> (Maybe v -> Maybe v) -> Dict comparable v -> Dict comparable v update targetKey alter dictionary = let maybeItemToSet = Data.Map.Strict.lookup targetKey dictionary |> alter @@ -139,18 +139,18 @@ singleton = -- | Combine two dictionaries. If there is a collision, preference is given -- to the first dictionary. -union :: Ord comparable => Dict comparable v -> Dict comparable v -> Dict comparable v +union :: (Ord comparable) => Dict comparable v -> Dict comparable v -> Dict comparable v union = Data.Map.Strict.union -- | Keep a key-value pair when its key appears in the second dictionary. -- Preference is given to values in the first dictionary. -intersect :: Ord comparable => Dict comparable v -> Dict comparable v -> Dict comparable v +intersect :: (Ord comparable) => Dict comparable v -> Dict comparable v -> Dict comparable v intersect = Data.Map.Strict.intersection -- | Keep a key-value pair when its key does not appear in the second dictionary. -diff :: Ord comparable => Dict comparable a -> Dict comparable b -> Dict comparable a +diff :: (Ord comparable) => Dict comparable a -> Dict comparable b -> Dict comparable a diff = Data.Map.Strict.difference @@ -164,7 +164,7 @@ diff = -- You then traverse all the keys from lowest to highest, building up whatever -- you want. merge :: - Ord comparable => + (Ord comparable) => (comparable -> a -> result -> result) -> (comparable -> a -> b -> result -> result) -> (comparable -> b -> result -> result) -> @@ -255,5 +255,5 @@ toList :: Dict k v -> List (k, v) toList = Data.Map.Strict.toList -- | Convert an association list into a dictionary. -fromList :: Ord comparable => List (comparable, v) -> Dict comparable v +fromList :: (Ord comparable) => List (comparable, v) -> Dict comparable v fromList = Data.Map.Strict.fromList diff --git a/nri-prelude/src/Expect.hs b/nri-prelude/src/Expect.hs index 74757a12..c322ff2b 100644 --- a/nri-prelude/src/Expect.hs +++ b/nri-prelude/src/Expect.hs @@ -93,7 +93,7 @@ import qualified Prelude -- > -- > Err err -> -- > Expect.fail err -pass :: Stack.HasCallStack => Expectation +pass :: (Stack.HasCallStack) => Expectation pass = Stack.withFrozenCallStack Internal.pass "Expect.pass" () -- | Fails with the given message. @@ -111,7 +111,7 @@ pass = Stack.withFrozenCallStack Internal.pass "Expect.pass" () -- > -- > Err err -> -- > Expect.fail err -fail :: Stack.HasCallStack => Text -> Expectation +fail :: (Stack.HasCallStack) => Text -> Expectation fail msg = Stack.withFrozenCallStack Internal.failAssertion "Expect.fail" msg @@ -120,7 +120,7 @@ fail msg = -- > "something" -- > |> Expect.equal "something else" -- > |> Expect.onFail "thought those two strings would be the same" -onFail :: Stack.HasCallStack => Text -> Expectation -> Expectation +onFail :: (Stack.HasCallStack) => Text -> Expectation -> Expectation onFail msg (Internal.Expectation task) = task |> Task.onError @@ -369,7 +369,7 @@ withinHelper tolerance expected actual = -- > Expected the list to be empty. -- > -- > -} -true :: Stack.HasCallStack => Bool -> Expectation +true :: (Stack.HasCallStack) => Bool -> Expectation true x = if x then Stack.withFrozenCallStack Internal.pass "Expect.true" () @@ -392,7 +392,7 @@ true x = -- > Expected the list not to be empty. -- > -- > -} -false :: Stack.HasCallStack => Bool -> Expectation +false :: (Stack.HasCallStack) => Bool -> Expectation false x = if x then Stack.withFrozenCallStack Internal.failAssertion "Expect.false" "I expected a False but got True" @@ -425,7 +425,7 @@ false x = -- > ╵ -- > -10 -- > -} -all :: Stack.HasCallStack => List (subject -> Expectation) -> subject -> Expectation +all :: (Stack.HasCallStack) => List (subject -> Expectation) -> subject -> Expectation all expectations subject = List.foldl ( \expectation acc -> @@ -522,7 +522,7 @@ err res = -- encodings. When a test fails we can throw away the file, rerun the test, and -- use @git diff golden-results/complicated-object.txt@ to check whether the -- changes are acceptable. -equalToContentsOf :: Stack.HasCallStack => Text -> Text -> Expectation +equalToContentsOf :: (Stack.HasCallStack) => Text -> Text -> Expectation equalToContentsOf filepath' actual = do let filepath = Data.Text.unpack filepath' exists <- diff --git a/nri-prelude/src/Internal/Shortcut.hs b/nri-prelude/src/Internal/Shortcut.hs index cfab3cb7..23f51abb 100644 --- a/nri-prelude/src/Internal/Shortcut.hs +++ b/nri-prelude/src/Internal/Shortcut.hs @@ -19,54 +19,54 @@ where import Prelude (Applicative, Functor, Monad, fmap, pure, (<*>), (>>=)) -andThen :: Monad m => (a -> m b) -> m a -> m b +andThen :: (Monad m) => (a -> m b) -> m a -> m b andThen b a = a >>= b -afterwards :: Monad m => m b -> m a -> m b +afterwards :: (Monad m) => m b -> m a -> m b afterwards b a = a >>= (\_ -> b) -map :: Functor m => (a -> value) -> m a -> m value +map :: (Functor m) => (a -> value) -> m a -> m value map = fmap -map2 :: Applicative m => (a -> b -> value) -> m a -> m b -> m value +map2 :: (Applicative m) => (a -> b -> value) -> m a -> m b -> m value map2 func a b = pure func <*> a <*> b -map3 :: Applicative m => (a -> b -> c -> value) -> m a -> m b -> m c -> m value +map3 :: (Applicative m) => (a -> b -> c -> value) -> m a -> m b -> m c -> m value map3 func a b c = pure func <*> a <*> b <*> c -map4 :: Applicative m => (a -> b -> c -> d -> value) -> m a -> m b -> m c -> m d -> m value +map4 :: (Applicative m) => (a -> b -> c -> d -> value) -> m a -> m b -> m c -> m d -> m value map4 func a b c d = pure func <*> a <*> b <*> c <*> d -map5 :: Applicative m => (a -> b -> c -> d -> e -> value) -> m a -> m b -> m c -> m d -> m e -> m value +map5 :: (Applicative m) => (a -> b -> c -> d -> e -> value) -> m a -> m b -> m c -> m d -> m e -> m value map5 func a b c d e = pure func <*> a <*> b <*> c <*> d <*> e -map6 :: Applicative m => (a -> b -> c -> d -> e -> f -> value) -> m a -> m b -> m c -> m d -> m e -> m f -> m value +map6 :: (Applicative m) => (a -> b -> c -> d -> e -> f -> value) -> m a -> m b -> m c -> m d -> m e -> m f -> m value map6 func a b c d e f = pure func <*> a <*> b <*> c <*> d <*> e <*> f -map7 :: Applicative m => (a -> b -> c -> d -> e -> f -> g -> value) -> m a -> m b -> m c -> m d -> m e -> m f -> m g -> m value +map7 :: (Applicative m) => (a -> b -> c -> d -> e -> f -> g -> value) -> m a -> m b -> m c -> m d -> m e -> m f -> m g -> m value map7 func a b c d e f g = pure func <*> a <*> b <*> c <*> d <*> e <*> f <*> g -map8 :: Applicative m => (a -> b -> c -> d -> e -> f -> g -> h -> value) -> m a -> m b -> m c -> m d -> m e -> m f -> m g -> m h -> m value +map8 :: (Applicative m) => (a -> b -> c -> d -> e -> f -> g -> h -> value) -> m a -> m b -> m c -> m d -> m e -> m f -> m g -> m h -> m value map8 func a b c d e f g h = pure func <*> a <*> b <*> c <*> d <*> e <*> f <*> g <*> h -map9 :: Applicative m => (a -> b -> c -> d -> e -> f -> g -> h -> i -> value) -> m a -> m b -> m c -> m d -> m e -> m f -> m g -> m h -> m i -> m value +map9 :: (Applicative m) => (a -> b -> c -> d -> e -> f -> g -> h -> i -> value) -> m a -> m b -> m c -> m d -> m e -> m f -> m g -> m h -> m i -> m value map9 func a b c d e f g h i = pure func <*> a <*> b <*> c <*> d <*> e <*> f <*> g <*> h <*> i -andMap :: Applicative m => m a -> m (a -> b) -> m b +andMap :: (Applicative m) => m a -> m (a -> b) -> m b andMap m mf = mf <*> m -blank :: Monad m => m () +blank :: (Monad m) => m () blank = pure () diff --git a/nri-prelude/src/List.hs b/nri-prelude/src/List.hs index 38e6cb53..43aa4497 100644 --- a/nri-prelude/src/List.hs +++ b/nri-prelude/src/List.hs @@ -181,7 +181,7 @@ reverse = -- -- > member 9 [1,2,3,4] == False -- > member 4 [1,2,3,4] == True -member :: Prelude.Eq a => a -> List a -> Bool +member :: (Prelude.Eq a) => a -> List a -> Bool member = Data.List.elem @@ -207,7 +207,7 @@ any = -- -- > maximum [1,4,2] == Just 4 -- > maximum [] == Nothing -maximum :: Ord a => List a -> Maybe a +maximum :: (Ord a) => List a -> Maybe a maximum list = case list of [] -> @@ -219,7 +219,7 @@ maximum list = -- -- > minimum [3,2,1] == Just 1 -- > minimum [] == Nothing -minimum :: Ord a => List a -> Maybe a +minimum :: (Ord a) => List a -> Maybe a minimum list = case list of [] -> @@ -230,14 +230,14 @@ minimum list = -- | Get the sum of the list elements. -- -- > sum [1,2,3,4] == 10 -sum :: Num a => List a -> a +sum :: (Num a) => List a -> a sum = Data.Foldable.sum -- | Get the product of the list elements. -- -- > product [1,2,3,4] == 24 -product :: Num a => List a -> a +product :: (Num a) => List a -> a product = Data.Foldable.product @@ -319,7 +319,7 @@ map5 = -- | Sort values from lowest to highest -- -- > sort [3,1,5] == [1,3,5] -sort :: Ord a => List a -> List a +sort :: (Ord a) => List a -> List a sort = Data.List.sort @@ -333,7 +333,7 @@ sort = -- > sortBy .height [chuck,alice,bob] == [alice,chuck,bob] -- > -- > sortBy String.length ["mouse","cat"] == ["cat","mouse"] -sortBy :: Ord b => (a -> b) -> List a -> List a +sortBy :: (Ord b) => (a -> b) -> List a -> List a sortBy = Data.List.sortOn diff --git a/nri-prelude/src/Log.hs b/nri-prelude/src/Log.hs index 3878b904..37dced6c 100644 --- a/nri-prelude/src/Log.hs +++ b/nri-prelude/src/Log.hs @@ -31,8 +31,8 @@ where import Data.Aeson ((.=)) import qualified Data.Aeson as Aeson -import qualified GHC.Stack as Stack import Data.Aeson.Key (fromText) +import qualified GHC.Stack as Stack import NriPrelude import qualified Platform import qualified Platform.Internal as Internal @@ -47,7 +47,7 @@ import qualified Prelude -- information that might be relevant for debugging. -- -- > debug "Computation partially succeeded" [context "answer" 2] -debug :: Stack.HasCallStack => Text -> [Context] -> Task e () +debug :: (Stack.HasCallStack) => Text -> [Context] -> Task e () debug message contexts = Stack.withFrozenCallStack log @@ -63,7 +63,7 @@ debug message contexts = -- information that might be relevant for debugging. -- -- > info "I added 1 and 1" [context "answer" 2] -info :: Stack.HasCallStack => Text -> [Context] -> Task e () +info :: (Stack.HasCallStack) => Text -> [Context] -> Task e () info message contexts = Stack.withFrozenCallStack log @@ -79,7 +79,7 @@ info message contexts = -- information that might be relevant for debugging. -- -- > warn "This field was sent, but we're gonna deprecate it!" [] -warn :: Stack.HasCallStack => Text -> [Context] -> Task e () +warn :: (Stack.HasCallStack) => Text -> [Context] -> Task e () warn message contexts = Stack.withFrozenCallStack log @@ -94,7 +94,7 @@ warn message contexts = -- information that might be relevant for debugging. -- -- > error "The user tried to request this thing, but they aren't allowed!" [] -error :: Stack.HasCallStack => Text -> [Context] -> Task e () +error :: (Stack.HasCallStack) => Text -> [Context] -> Task e () error message contexts = Stack.withFrozenCallStack log @@ -122,7 +122,7 @@ error message contexts = -- the stack trace, since it is used fairly often already. It will not be complete either, but -- it's the best we can do without too much trouble. withContext :: - Stack.HasCallStack => + (Stack.HasCallStack) => Text -> [Context] -> Task e b -> @@ -235,7 +235,7 @@ instance Aeson.ToJSON LogLevel -- ReportAsFailed marks the request as a failure in logging, but has no impact on the resulting Task. E.g. will not trigger a 500 error but will report an error to, e.g. BugSnag. data ReportStatus = ReportAsFailed | ReportAsSucceeded -log :: Stack.HasCallStack => Text -> ReportStatus -> [Context] -> Task e () +log :: (Stack.HasCallStack) => Text -> ReportStatus -> [Context] -> Task e () log msg reportStatus contexts = Internal.tracingSpan msg <| do Platform.setTracingSpanDetails (LogContexts contexts) diff --git a/nri-prelude/src/NriPrelude/Plugin.hs b/nri-prelude/src/NriPrelude/Plugin.hs index 05b5c158..5a0f1e60 100644 --- a/nri-prelude/src/NriPrelude/Plugin.hs +++ b/nri-prelude/src/NriPrelude/Plugin.hs @@ -22,11 +22,9 @@ where import Data.Function ((&)) import qualified Data.List - import qualified GHC.Hs import qualified GHC.Parser.Annotation import qualified GHC.Plugins - import NriPrelude.Plugin.GhcVersionDependent (setIDeclImplicit, withParsedResult) import qualified Set import Prelude @@ -51,13 +49,8 @@ plugin = addImplicitImports :: [GHC.Plugins.CommandLineOption] -> GHC.Plugins.ModSummary -> -#if __GLASGOW_HASKELL__ >= 904 GHC.Plugins.ParsedResult -> GHC.Plugins.Hsc GHC.Plugins.ParsedResult -#else - GHC.Hs.HsParsedModule -> - GHC.Plugins.Hsc GHC.Hs.HsParsedModule -#endif addImplicitImports _ _ parsed = Prelude.pure $ withParsedResult parsed $ \parsed' -> diff --git a/nri-prelude/src/NriPrelude/Plugin/GhcVersionDependent.hs b/nri-prelude/src/NriPrelude/Plugin/GhcVersionDependent.hs index d8957232..4346647c 100644 --- a/nri-prelude/src/NriPrelude/Plugin/GhcVersionDependent.hs +++ b/nri-prelude/src/NriPrelude/Plugin/GhcVersionDependent.hs @@ -4,29 +4,22 @@ -- versions of GHC. This module uses the CPP extension to import the -- right values dependent on the version of GHC. -module NriPrelude.Plugin.GhcVersionDependent ( - setIDeclImplicit, - withParsedResult -) where +module NriPrelude.Plugin.GhcVersionDependent + ( setIDeclImplicit, + withParsedResult, + ) +where +import qualified GHC.Driver.Plugins import qualified GHC.Hs -import qualified GHC.Hs.ImpExp +import qualified GHC.Hs.ImpExp import Prelude -#if __GLASGOW_HASKELL__ >= 904 -import qualified GHC.Driver.Plugins -#endif - -#if __GLASGOW_HASKELL__ >= 904 withParsedResult :: GHC.Driver.Plugins.ParsedResult -> (GHC.Hs.HsParsedModule -> GHC.Hs.HsParsedModule) -> GHC.Driver.Plugins.ParsedResult withParsedResult parsed f = parsed { GHC.Driver.Plugins.parsedResultModule = f (GHC.Driver.Plugins.parsedResultModule parsed) } -#else -withParsedResult :: GHC.Hs.HsParsedModule -> (GHC.Hs.HsParsedModule -> GHC.Hs.HsParsedModule) -> GHC.Hs.HsParsedModule -withParsedResult parsed f = f parsed -#endif #if __GLASGOW_HASKELL__ >= 906 setIDeclImplicit :: Bool -> GHC.Hs.ImpExp.ImportDecl GHC.Hs.GhcPs -> GHC.Hs.ImpExp.ImportDecl GHC.Hs.GhcPs diff --git a/nri-prelude/src/Platform.hs b/nri-prelude/src/Platform.hs index c998ff5f..efd8ca47 100644 --- a/nri-prelude/src/Platform.hs +++ b/nri-prelude/src/Platform.hs @@ -182,10 +182,10 @@ silentHandler = Internal.mkHandler "" (Internal.Clock (pure 0)) (\_ -> pure ()) -- throw an exception in @Control.Exception@, because it results in better logs -- for those who'll need to investigate these problems. unsafeThrowException :: - Stack.HasCallStack => + (Stack.HasCallStack) => Text -> Task e a unsafeThrowException title = - Internal.Task - <| \_ -> + Internal.Task <| + \_ -> Exception.throwString (Data.Text.unpack title) diff --git a/nri-prelude/src/Platform/Internal.hs b/nri-prelude/src/Platform/Internal.hs index 09e12ba0..41f42870 100644 --- a/nri-prelude/src/Platform/Internal.hs +++ b/nri-prelude/src/Platform/Internal.hs @@ -171,23 +171,23 @@ instance Aeson.ToJSON TracingSpan where ( "name" .= name span ++ "started" - .= started span + .= started span ++ "finished" - .= finished span + .= finished span ++ "frame" - .= map SrcLocForEncoding (frame span) + .= map SrcLocForEncoding (frame span) ++ "details" - .= details span + .= details span ++ "summary" - .= summary span + .= summary span ++ "succeeded" - .= succeeded span + .= succeeded span ++ "containsFailures" - .= containsFailures span + .= containsFailures span ++ "allocated" - .= allocated span + .= allocated span ++ "children" - .= children span + .= children span ) instance Aeson.FromJSON TracingSpan where @@ -239,19 +239,19 @@ instance Aeson.ToJSON SrcLocForEncoding where ( "name" .= name ++ "package" - .= Stack.srcLocPackage loc + .= Stack.srcLocPackage loc ++ "module" - .= Stack.srcLocModule loc + .= Stack.srcLocModule loc ++ "file" - .= Stack.srcLocFile loc + .= Stack.srcLocFile loc ++ "startLine" - .= Stack.srcLocStartLine loc + .= Stack.srcLocStartLine loc ++ "startCol" - .= Stack.srcLocStartCol loc + .= Stack.srcLocStartCol loc ++ "endLine" - .= Stack.srcLocEndLine loc + .= Stack.srcLocEndLine loc ++ "endCol" - .= Stack.srcLocEndCol loc + .= Stack.srcLocEndCol loc ) instance Aeson.FromJSON SrcLocForEncoding where @@ -485,7 +485,7 @@ class (Typeable.Typeable e, Aeson.ToJSON e) => TracingSpanDetails e where -- | A helper type used for @renderTracingSpanDetails@. Used to wrap rendering -- functions so they have the same type and can be put in a list together. data Renderer a where - Renderer :: TracingSpanDetails s => (s -> a) -> Renderer a + Renderer :: (TracingSpanDetails s) => (s -> a) -> Renderer a -- | In reporting logic we'd like to case on the different types a -- 'SomeTracingSpanDetails' can contain and write logic for each one. This @@ -544,14 +544,14 @@ data LogHandler = LogHandler -- debugging information using a handler we'll know which tracingSpan -- the information belongs to. This function creates a new handler for -- a child tracingSpan of the current handler. - startChildTracingSpan :: Stack.HasCallStack => Text -> IO LogHandler, + startChildTracingSpan :: (Stack.HasCallStack) => Text -> IO LogHandler, -- | This allows creating a new `LogHandler` with the same behaviour as -- the root of this LogHandler. Remember that every tracingSpan gets its -- own handler, and that tracingSpans form a tree. Allowing a tracingSpan -- which copies the behaviour of the root allows long-lived constructs to -- treat its children as a new root. For example, a webserver could use -- this to create a new tracingSpan for each request. - startNewRoot :: Stack.HasCallStack => Text -> IO LogHandler, + startNewRoot :: (Stack.HasCallStack) => Text -> IO LogHandler, -- | There's common fields all tracingSpans have such as a name and -- start and finish times. On top of that each tracingSpan can define a -- custom type containing useful custom data. This function allows us @@ -560,7 +560,7 @@ data LogHandler = LogHandler -- tracingSpan, but then we'd miss out on useful details that only -- become known as the tracingSpan runs, for example the response code -- of an HTTP request. - setTracingSpanDetailsIO :: forall d. TracingSpanDetails d => d -> IO (), + setTracingSpanDetailsIO :: forall d. (TracingSpanDetails d) => d -> IO (), -- | Set a summary for the current tracingSpan. This is shown in tools -- used to inspect spans as a stand-in for the full tracingSpan details -- in places where we only have room to show a little text. @@ -585,7 +585,7 @@ data LogHandler = LogHandler -- library the @rootTracingSpanIO@ is the more user-friendly way to get hands -- on a @LogHandler@. mkHandler :: - Stack.HasCallStack => + (Stack.HasCallStack) => Text -> Clock -> -- Finalizer for this loghandler @@ -639,7 +639,7 @@ mkHandler requestId clock onFinish onFinishRoot' name' = do -- > deriving (Aeson.ToJSON) -- > -- > instance TracingSpanDetails BookPick -setTracingSpanDetails :: TracingSpanDetails d => d -> Task e () +setTracingSpanDetails :: (TracingSpanDetails d) => d -> Task e () setTracingSpanDetails details = Task ( \handler -> @@ -675,7 +675,7 @@ markTracingSpanFailed = Task (map Ok << markTracingSpanFailedIO) -- | Create an initial @TracingSpan@ with some initial values. -startTracingSpan :: Stack.HasCallStack => Clock -> Text -> IO TracingSpan +startTracingSpan :: (Stack.HasCallStack) => Clock -> Text -> IO TracingSpan startTracingSpan clock name = do started <- monotonicTimeInMsec clock pure @@ -765,7 +765,7 @@ updateIORef ref f = IORef.atomicModifyIORef' ref (\x -> (f x, ())) -- -- This will help provide better debugging information if something goes wrong -- inside the wrapped task. -tracingSpan :: Stack.HasCallStack => Text -> Task e a -> Task e a +tracingSpan :: (Stack.HasCallStack) => Text -> Task e a -> Task e a tracingSpan name (Task run) = Task ( \handler -> @@ -784,7 +784,7 @@ tracingSpan name (Task run) = -- -- This can help in flushing logs; by replacing the parent span, we also -- "inherit" its finalization point -newRoot :: Stack.HasCallStack => Text -> Task e a -> Task e a +newRoot :: (Stack.HasCallStack) => Text -> Task e a -> Task e a newRoot name (Task run) = Task ( \handler -> @@ -802,7 +802,7 @@ newRoot name (Task run) = -- > tracingSpanIO handler "code dance" <| \childHandler -> do -- > waltzPassLeft childHandler -- > clockwiseTurn childHandler 60 -tracingSpanIO :: Stack.HasCallStack => LogHandler -> Text -> (LogHandler -> IO a) -> IO a +tracingSpanIO :: (Stack.HasCallStack) => LogHandler -> Text -> (LogHandler -> IO a) -> IO a tracingSpanIO handler name run = Exception.bracketWithError (Stack.withFrozenCallStack (startChildTracingSpan handler name)) @@ -816,7 +816,7 @@ tracingSpanIO handler name run = -- > newRootIO handler "code dance" <| \childHandler -> do -- > waltzPassLeft childHandler -- > clockwiseTurn childHandler 60 -newRootIO :: Stack.HasCallStack => LogHandler -> Text -> (LogHandler -> IO a) -> IO a +newRootIO :: (Stack.HasCallStack) => LogHandler -> Text -> (LogHandler -> IO a) -> IO a newRootIO handler name run = do Exception.bracketWithError (Stack.withFrozenCallStack (startNewRoot handler name)) @@ -830,7 +830,7 @@ newRootIO handler name run = do -- > rootTracingSpanIO "request-23" Prelude.print "incoming request" <| \handler -> -- > handleRequest -- > |> Task.perform handler -rootTracingSpanIO :: Stack.HasCallStack => Text -> (TracingSpan -> IO ()) -> Text -> (LogHandler -> IO a) -> IO a +rootTracingSpanIO :: (Stack.HasCallStack) => Text -> (TracingSpan -> IO ()) -> Text -> (LogHandler -> IO a) -> IO a rootTracingSpanIO requestId onFinish name runIO = do clock' <- mkClock Exception.bracketWithError diff --git a/nri-prelude/src/Set.hs b/nri-prelude/src/Set.hs index 3a206309..0ce97780 100644 --- a/nri-prelude/src/Set.hs +++ b/nri-prelude/src/Set.hs @@ -57,12 +57,12 @@ singleton = Data.Set.singleton -- | Insert a value into a set. -insert :: Ord comparable => comparable -> Set comparable -> Set comparable +insert :: (Ord comparable) => comparable -> Set comparable -> Set comparable insert = Data.Set.insert -- | Remove a value from a set. If the value is not found, no changes are made. -remove :: Ord comparable => comparable -> Set comparable -> Set comparable +remove :: (Ord comparable) => comparable -> Set comparable -> Set comparable remove = Data.Set.delete @@ -72,7 +72,7 @@ isEmpty = Data.Set.null -- | Determine if a value is in a set. -member :: Ord comparable => comparable -> Set comparable -> Bool +member :: (Ord comparable) => comparable -> Set comparable -> Bool member = Data.Set.member @@ -86,7 +86,7 @@ size = -- -- In Elm it's not possible to have two comparable elements that are not equal, but -- it is possible in Haskell. -union :: Ord comparable => Set comparable -> Set comparable -> Set comparable +union :: (Ord comparable) => Set comparable -> Set comparable -> Set comparable union = Data.Set.union @@ -95,13 +95,13 @@ union = -- -- In Elm it's not possible to have two comparable elements that are not equal, but -- it is possible in Haskell. -intersect :: Ord comparable => Set comparable -> Set comparable -> Set comparable +intersect :: (Ord comparable) => Set comparable -> Set comparable -> Set comparable intersect = Data.Set.intersection -- | Get the difference between the first set and the second. Keeps values -- that do not appear in the second set. -diff :: Ord comparable => Set comparable -> Set comparable -> Set comparable +diff :: (Ord comparable) => Set comparable -> Set comparable -> Set comparable diff = Data.Set.difference @@ -111,7 +111,7 @@ toList = Data.Set.toAscList -- | Convert a list into a set, removing any duplicates. -fromList :: Ord comparable => List comparable -> Set comparable +fromList :: (Ord comparable) => List comparable -> Set comparable fromList = Data.Set.fromList @@ -126,7 +126,7 @@ foldr = Data.Set.foldr' -- | Map a function onto a set, creating a new set with no duplicates. -map :: Ord comparable2 => (comparable -> comparable2) -> Set comparable -> Set comparable2 +map :: (Ord comparable2) => (comparable -> comparable2) -> Set comparable -> Set comparable2 map = Data.Set.map diff --git a/nri-prelude/src/Test.hs b/nri-prelude/src/Test.hs index ea28f1a4..0f875f65 100644 --- a/nri-prelude/src/Test.hs +++ b/nri-prelude/src/Test.hs @@ -50,7 +50,7 @@ import qualified Prelude -- > -- > main :: IO () -- > main = Test.run (Test.todo "write your tests here!") -run :: Stack.HasCallStack => Internal.Test -> Prelude.IO () +run :: (Stack.HasCallStack) => Internal.Test -> Prelude.IO () run suite = do -- Work around `hGetContents: invalid argument (invalid byte sequence)` bug on -- Nix: https://github.com/dhall-lang/dhall-haskell/issues/865 @@ -84,7 +84,7 @@ reportStdout :: Internal.SuiteResult -> Prelude.IO () reportStdout results = Test.Reporter.Stdout.report System.IO.stdout results -reportLogfile :: Stack.HasCallStack => Internal.SuiteResult -> Prelude.IO () +reportLogfile :: (Stack.HasCallStack) => Internal.SuiteResult -> Prelude.IO () reportLogfile results = Stack.withFrozenCallStack Test.Reporter.Logfile.report diff --git a/nri-prelude/src/Test/Internal.hs b/nri-prelude/src/Test/Internal.hs index 374d6326..ab40181c 100644 --- a/nri-prelude/src/Test/Internal.hs +++ b/nri-prelude/src/Test/Internal.hs @@ -154,7 +154,7 @@ describe description tests = -- -- This functionality is similar to "pending" tests in other frameworks, except -- that a todo test is considered failing but a pending test often is not. -todo :: Stack.HasCallStack => Text -> Test +todo :: (Stack.HasCallStack) => Text -> Test todo name = Test [ SingleTest @@ -176,7 +176,7 @@ todo name = -- > \_ -> -- > List.length [] -- > |> Expect.equal 0 -test :: Stack.HasCallStack => Text -> (() -> Expectation) -> Test +test :: (Stack.HasCallStack) => Text -> (() -> Expectation) -> Test test name expectation = Test [ SingleTest @@ -260,7 +260,7 @@ fuzz3 (Fuzzer genA) (Fuzzer genB) (Fuzzer genC) name expectation = } ] -fuzzBody :: Show a => Fuzzer a -> (a -> Expectation) -> Expectation +fuzzBody :: (Show a) => Fuzzer a -> (a -> Expectation) -> Expectation fuzzBody (Fuzzer gen) expectation = do Expectation <| Platform.Internal.Task @@ -552,7 +552,7 @@ onException f (Platform.Internal.Task run') = |> Exception.handleAny (Task.attempt log << f) ) -getFrame :: Stack.HasCallStack => Text -> Stack.SrcLoc +getFrame :: (Stack.HasCallStack) => Text -> Stack.SrcLoc getFrame testName = case Stack.callStack |> Stack.getCallStack |> List.head of Just (_, srcLoc) -> @@ -566,7 +566,7 @@ getFrame testName = |> TestRunnerMessedUp |> Exception.impureThrow -groupBy :: Ord key => (a -> key) -> [a] -> Dict.Dict key [a] +groupBy :: (Ord key) => (a -> key) -> [a] -> Dict.Dict key [a] groupBy key xs = List.foldr ( \x acc -> @@ -594,16 +594,16 @@ append (Expectation task1) (Expectation task2) = -- never each other, to ensure a single unnested 'expectation' entry from -- appearing in log-explorer traces. -pass :: Stack.HasCallStack => Text -> a -> Expectation' a +pass :: (Stack.HasCallStack) => Text -> a -> Expectation' a pass name a = Stack.withFrozenCallStack traceExpectation name (Task.succeed a) -failAssertion :: Stack.HasCallStack => Text -> Text -> Expectation' a +failAssertion :: (Stack.HasCallStack) => Text -> Text -> Expectation' a failAssertion name err = FailedAssertion err (Stack.withFrozenCallStack getFrame name) |> Task.fail |> Stack.withFrozenCallStack traceExpectation name -traceExpectation :: Stack.HasCallStack => Text -> Task Failure a -> Expectation' a +traceExpectation :: (Stack.HasCallStack) => Text -> Task Failure a -> Expectation' a traceExpectation name task = Stack.withFrozenCallStack Platform.tracingSpan diff --git a/nri-prelude/src/Test/Reporter/Logfile.hs b/nri-prelude/src/Test/Reporter/Logfile.hs index 1d59f1e7..56e594d0 100644 --- a/nri-prelude/src/Test/Reporter/Logfile.hs +++ b/nri-prelude/src/Test/Reporter/Logfile.hs @@ -17,7 +17,7 @@ import qualified Tuple import qualified Prelude report :: - Stack.HasCallStack => + (Stack.HasCallStack) => (Platform.TracingSpan -> Prelude.IO ()) -> Internal.SuiteResult -> Prelude.IO () @@ -113,7 +113,7 @@ groupIntoNamespaces namespacedSpans = ] ) -groupBy :: Ord b => (a -> b) -> List a -> Dict.Dict b (List a) +groupBy :: (Ord b) => (a -> b) -> List a -> Dict.Dict b (List a) groupBy f list = List.foldr ( \x -> diff --git a/nri-prelude/tests/ArraySpec.hs b/nri-prelude/tests/ArraySpec.hs index 12aa8396..e817337b 100644 --- a/nri-prelude/tests/ArraySpec.hs +++ b/nri-prelude/tests/ArraySpec.hs @@ -38,7 +38,8 @@ initTests = |> toList |> Expect.equal (List.range 0 (size_ - 1)), fuzz size "push" <| \size_ -> - size_ - 1 + size_ + - 1 |> List.range 0 |> List.foldl push empty |> Expect.equal (initialize size_ identity), diff --git a/nri-prelude/tests/DebugSpec.hs b/nri-prelude/tests/DebugSpec.hs index 838a3f37..56b84722 100644 --- a/nri-prelude/tests/DebugSpec.hs +++ b/nri-prelude/tests/DebugSpec.hs @@ -42,6 +42,6 @@ todoTests = ] -- | Extracts the first line of a given text string if it exists. Otherwise returns Nothing. -firstLine :: Show a => a -> Maybe Text +firstLine :: (Show a) => a -> Maybe Text firstLine = Debug.toString >> Text.lines >> head diff --git a/nri-prelude/tests/GoldenHelpers.hs b/nri-prelude/tests/GoldenHelpers.hs index 1008389f..d6372647 100644 --- a/nri-prelude/tests/GoldenHelpers.hs +++ b/nri-prelude/tests/GoldenHelpers.hs @@ -13,13 +13,12 @@ import Data.Text (Text) -- > foo -- > bar -- > baz --- +-- -- In GHC 8.10.x (and possibly GHC 9.0.x?) `srcLocEndLine` and `srcLocEndCol` -- would correspond to the `z` at the end of `baz`. Unfortunately, in GHC 9.2.x -- it corresponds to the second `o` at the end of `foo`. -- -- We keep this helper around so that if this happens again for future GHC versions -- we can have different golden results for different GHC versions as necessary. - goldenResultsDir :: Text -goldenResultsDir = "tests/golden-results-9.2" +goldenResultsDir = "tests/golden-results-9.8" diff --git a/nri-prelude/tests/LogSpec.hs b/nri-prelude/tests/LogSpec.hs index 396f9bfb..8cc12820 100644 --- a/nri-prelude/tests/LogSpec.hs +++ b/nri-prelude/tests/LogSpec.hs @@ -187,7 +187,7 @@ data TestException = TestException deriving (Show) instance Exception.Exception TestException -newHandler :: Stack.HasCallStack => Prelude.IO (Prelude.IO [Internal.TracingSpan], Internal.LogHandler) +newHandler :: (Stack.HasCallStack) => Prelude.IO (Prelude.IO [Internal.TracingSpan], Internal.LogHandler) newHandler = do recordedTracingSpans <- IORef.newIORef [] handler <- diff --git a/nri-prelude/tests/golden-results-9.2/debug-todo-stacktrace b/nri-prelude/tests/golden-results-9.2/debug-todo-stacktrace deleted file mode 100644 index 217f6d84..00000000 --- a/nri-prelude/tests/golden-results-9.2/debug-todo-stacktrace +++ /dev/null @@ -1,3 +0,0 @@ -foo -CallStack (from HasCallStack): - todo, called at tests/TestSpec.hs:177:20 in main:TestSpec \ No newline at end of file diff --git a/nri-prelude/tests/golden-results-9.2/debug b/nri-prelude/tests/golden-results-9.8/debug similarity index 90% rename from nri-prelude/tests/golden-results-9.2/debug rename to nri-prelude/tests/golden-results-9.8/debug index 1ae03137..a2629768 100644 --- a/nri-prelude/tests/golden-results-9.2/debug +++ b/nri-prelude/tests/golden-results-9.8/debug @@ -6,7 +6,7 @@ Just ( "debug" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 40 diff --git a/nri-prelude/tests/golden-results-9.8/debug-todo-stacktrace b/nri-prelude/tests/golden-results-9.8/debug-todo-stacktrace new file mode 100644 index 00000000..c493c9d1 --- /dev/null +++ b/nri-prelude/tests/golden-results-9.8/debug-todo-stacktrace @@ -0,0 +1,3 @@ +foo +CallStack (from HasCallStack): + todo, called at tests/TestSpec.hs:177:20 in nri-prelude-0.6.1.2-inplace-tests:TestSpec \ No newline at end of file diff --git a/nri-prelude/tests/golden-results-9.2/error b/nri-prelude/tests/golden-results-9.8/error similarity index 90% rename from nri-prelude/tests/golden-results-9.2/error rename to nri-prelude/tests/golden-results-9.8/error index c0f7a27d..4b550b43 100644 --- a/nri-prelude/tests/golden-results-9.2/error +++ b/nri-prelude/tests/golden-results-9.8/error @@ -6,7 +6,7 @@ Just ( "error" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 66 diff --git a/nri-prelude/tests/golden-results-9.2/log-async-exceptions b/nri-prelude/tests/golden-results-9.8/log-async-exceptions similarity index 91% rename from nri-prelude/tests/golden-results-9.2/log-async-exceptions rename to nri-prelude/tests/golden-results-9.8/log-async-exceptions index 2b7de961..9960f182 100644 --- a/nri-prelude/tests/golden-results-9.2/log-async-exceptions +++ b/nri-prelude/tests/golden-results-9.8/log-async-exceptions @@ -6,7 +6,7 @@ Just ( "withContext" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 113 @@ -29,7 +29,7 @@ Just ( "withContext" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 112 diff --git a/nri-prelude/tests/golden-results-9.2/log-context-show b/nri-prelude/tests/golden-results-9.8/log-context-show similarity index 100% rename from nri-prelude/tests/golden-results-9.2/log-context-show rename to nri-prelude/tests/golden-results-9.8/log-context-show diff --git a/nri-prelude/tests/golden-results-9.2/log-info b/nri-prelude/tests/golden-results-9.8/log-info similarity index 90% rename from nri-prelude/tests/golden-results-9.2/log-info rename to nri-prelude/tests/golden-results-9.8/log-info index 9f4c568f..9bc7042a 100644 --- a/nri-prelude/tests/golden-results-9.2/log-info +++ b/nri-prelude/tests/golden-results-9.8/log-info @@ -6,7 +6,7 @@ Just ( "info" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 30 diff --git a/nri-prelude/tests/golden-results-9.2/log-nested-spans b/nri-prelude/tests/golden-results-9.8/log-nested-spans similarity index 91% rename from nri-prelude/tests/golden-results-9.2/log-nested-spans rename to nri-prelude/tests/golden-results-9.8/log-nested-spans index a759079f..5bee1860 100644 --- a/nri-prelude/tests/golden-results-9.2/log-nested-spans +++ b/nri-prelude/tests/golden-results-9.8/log-nested-spans @@ -6,7 +6,7 @@ Just ( "withContext" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 81 @@ -29,7 +29,7 @@ Just ( "withContext" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 80 @@ -52,7 +52,7 @@ Just ( "info" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 79 diff --git a/nri-prelude/tests/golden-results-9.2/log-new-root b/nri-prelude/tests/golden-results-9.8/log-new-root similarity index 90% rename from nri-prelude/tests/golden-results-9.2/log-new-root rename to nri-prelude/tests/golden-results-9.8/log-new-root index 2d9f9a31..0547be4d 100644 --- a/nri-prelude/tests/golden-results-9.2/log-new-root +++ b/nri-prelude/tests/golden-results-9.8/log-new-root @@ -6,7 +6,7 @@ Just ( "info" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 174 @@ -30,7 +30,7 @@ Just ( "info" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 177 @@ -54,7 +54,7 @@ Just ( "info" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 176 @@ -78,7 +78,7 @@ Just ( "withContext" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 173 @@ -101,7 +101,7 @@ Just ( "info" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 173 diff --git a/nri-prelude/tests/golden-results-9.2/log-unexpected-exceptions b/nri-prelude/tests/golden-results-9.8/log-unexpected-exceptions similarity index 91% rename from nri-prelude/tests/golden-results-9.2/log-unexpected-exceptions rename to nri-prelude/tests/golden-results-9.8/log-unexpected-exceptions index 69de28fb..94fa4f8f 100644 --- a/nri-prelude/tests/golden-results-9.2/log-unexpected-exceptions +++ b/nri-prelude/tests/golden-results-9.8/log-unexpected-exceptions @@ -6,7 +6,7 @@ Just ( "withContext" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 94 @@ -29,7 +29,7 @@ Just ( "withContext" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 93 diff --git a/nri-prelude/tests/golden-results-9.2/test-report-logfile-all-passed b/nri-prelude/tests/golden-results-9.8/test-report-logfile-all-passed similarity index 97% rename from nri-prelude/tests/golden-results-9.2/test-report-logfile-all-passed rename to nri-prelude/tests/golden-results-9.8/test-report-logfile-all-passed index 55106d7a..c2b9bf64 100644 --- a/nri-prelude/tests/golden-results-9.2/test-report-logfile-all-passed +++ b/nri-prelude/tests/golden-results-9.8/test-report-logfile-all-passed @@ -61,7 +61,7 @@ "file": "tests/TestSpec.hs", "module": "TestSpec", "name": "report", - "package": "main", + "package": "nri-prelude-0.6.1.2-inplace-tests", "startCol": 22, "startLine": 429 }, diff --git a/nri-prelude/tests/golden-results-9.2/test-report-logfile-no-tests-in-suite b/nri-prelude/tests/golden-results-9.8/test-report-logfile-no-tests-in-suite similarity index 88% rename from nri-prelude/tests/golden-results-9.2/test-report-logfile-no-tests-in-suite rename to nri-prelude/tests/golden-results-9.8/test-report-logfile-no-tests-in-suite index 2728ebbf..f536a65c 100644 --- a/nri-prelude/tests/golden-results-9.2/test-report-logfile-no-tests-in-suite +++ b/nri-prelude/tests/golden-results-9.8/test-report-logfile-no-tests-in-suite @@ -10,7 +10,7 @@ "file": "tests/TestSpec.hs", "module": "TestSpec", "name": "report", - "package": "main", + "package": "nri-prelude-0.6.1.2-inplace-tests", "startCol": 22, "startLine": 468 }, diff --git a/nri-prelude/tests/golden-results-9.2/test-report-logfile-onlys-passed b/nri-prelude/tests/golden-results-9.8/test-report-logfile-onlys-passed similarity index 97% rename from nri-prelude/tests/golden-results-9.2/test-report-logfile-onlys-passed rename to nri-prelude/tests/golden-results-9.8/test-report-logfile-onlys-passed index bd38fb9e..f81c5a48 100644 --- a/nri-prelude/tests/golden-results-9.2/test-report-logfile-onlys-passed +++ b/nri-prelude/tests/golden-results-9.8/test-report-logfile-onlys-passed @@ -61,7 +61,7 @@ "file": "tests/TestSpec.hs", "module": "TestSpec", "name": "report", - "package": "main", + "package": "nri-prelude-0.6.1.2-inplace-tests", "startCol": 22, "startLine": 444 }, diff --git a/nri-prelude/tests/golden-results-9.2/test-report-logfile-passed-with-skipped b/nri-prelude/tests/golden-results-9.8/test-report-logfile-passed-with-skipped similarity index 97% rename from nri-prelude/tests/golden-results-9.2/test-report-logfile-passed-with-skipped rename to nri-prelude/tests/golden-results-9.8/test-report-logfile-passed-with-skipped index 8e37425e..0e6bcb68 100644 --- a/nri-prelude/tests/golden-results-9.2/test-report-logfile-passed-with-skipped +++ b/nri-prelude/tests/golden-results-9.8/test-report-logfile-passed-with-skipped @@ -61,7 +61,7 @@ "file": "tests/TestSpec.hs", "module": "TestSpec", "name": "report", - "package": "main", + "package": "nri-prelude-0.6.1.2-inplace-tests", "startCol": 22, "startLine": 459 }, diff --git a/nri-prelude/tests/golden-results-9.2/test-report-logfile-tests-failed b/nri-prelude/tests/golden-results-9.8/test-report-logfile-tests-failed similarity index 98% rename from nri-prelude/tests/golden-results-9.2/test-report-logfile-tests-failed rename to nri-prelude/tests/golden-results-9.8/test-report-logfile-tests-failed index 3bccebf3..25515631 100644 --- a/nri-prelude/tests/golden-results-9.2/test-report-logfile-tests-failed +++ b/nri-prelude/tests/golden-results-9.8/test-report-logfile-tests-failed @@ -109,7 +109,7 @@ "file": "tests/TestSpec.hs", "module": "TestSpec", "name": "report", - "package": "main", + "package": "nri-prelude-0.6.1.2-inplace-tests", "startCol": 22, "startLine": 488 }, diff --git a/nri-prelude/tests/golden-results-9.2/test-report-stdout-all-passed b/nri-prelude/tests/golden-results-9.8/test-report-stdout-all-passed similarity index 100% rename from nri-prelude/tests/golden-results-9.2/test-report-stdout-all-passed rename to nri-prelude/tests/golden-results-9.8/test-report-stdout-all-passed diff --git a/nri-prelude/tests/golden-results-9.2/test-report-stdout-no-tests-in-suite b/nri-prelude/tests/golden-results-9.8/test-report-stdout-no-tests-in-suite similarity index 100% rename from nri-prelude/tests/golden-results-9.2/test-report-stdout-no-tests-in-suite rename to nri-prelude/tests/golden-results-9.8/test-report-stdout-no-tests-in-suite diff --git a/nri-prelude/tests/golden-results-9.2/test-report-stdout-onlys-passed b/nri-prelude/tests/golden-results-9.8/test-report-stdout-onlys-passed similarity index 100% rename from nri-prelude/tests/golden-results-9.2/test-report-stdout-onlys-passed rename to nri-prelude/tests/golden-results-9.8/test-report-stdout-onlys-passed diff --git a/nri-prelude/tests/golden-results-9.2/test-report-stdout-passed-with-skipped b/nri-prelude/tests/golden-results-9.8/test-report-stdout-passed-with-skipped similarity index 100% rename from nri-prelude/tests/golden-results-9.2/test-report-stdout-passed-with-skipped rename to nri-prelude/tests/golden-results-9.8/test-report-stdout-passed-with-skipped diff --git a/nri-prelude/tests/golden-results-9.2/test-report-stdout-tests-failed b/nri-prelude/tests/golden-results-9.8/test-report-stdout-tests-failed similarity index 100% rename from nri-prelude/tests/golden-results-9.2/test-report-stdout-tests-failed rename to nri-prelude/tests/golden-results-9.8/test-report-stdout-tests-failed diff --git a/nri-prelude/tests/golden-results-9.2/test-report-stdout-tests-failed-loc b/nri-prelude/tests/golden-results-9.8/test-report-stdout-tests-failed-loc similarity index 100% rename from nri-prelude/tests/golden-results-9.2/test-report-stdout-tests-failed-loc rename to nri-prelude/tests/golden-results-9.8/test-report-stdout-tests-failed-loc diff --git a/nri-prelude/tests/golden-results-9.2/test-report-stdout-tests-failed-loc-one-file b/nri-prelude/tests/golden-results-9.8/test-report-stdout-tests-failed-loc-one-file similarity index 100% rename from nri-prelude/tests/golden-results-9.2/test-report-stdout-tests-failed-loc-one-file rename to nri-prelude/tests/golden-results-9.8/test-report-stdout-tests-failed-loc-one-file diff --git a/nri-prelude/tests/golden-results-9.2/test-report-stdout-tests-failed-loc-subset b/nri-prelude/tests/golden-results-9.8/test-report-stdout-tests-failed-loc-subset similarity index 100% rename from nri-prelude/tests/golden-results-9.2/test-report-stdout-tests-failed-loc-subset rename to nri-prelude/tests/golden-results-9.8/test-report-stdout-tests-failed-loc-subset diff --git a/nri-prelude/tests/golden-results-9.2/warn b/nri-prelude/tests/golden-results-9.8/warn similarity index 90% rename from nri-prelude/tests/golden-results-9.2/warn rename to nri-prelude/tests/golden-results-9.8/warn index 4b41b2dc..aaf7b246 100644 --- a/nri-prelude/tests/golden-results-9.2/warn +++ b/nri-prelude/tests/golden-results-9.8/warn @@ -6,7 +6,7 @@ Just ( "warn" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-prelude-0.6.1.2-inplace-tests" , srcLocModule = "LogSpec" , srcLocFile = "tests/LogSpec.hs" , srcLocStartLine = 53 diff --git a/nri-redis/CHANGELOG.md b/nri-redis/CHANGELOG.md index 250b8f83..d9b39b11 100644 --- a/nri-redis/CHANGELOG.md +++ b/nri-redis/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.3.0.0 + +- Drop support for GHC 9.2.x +- Support GHC 9.8.3, `bytestring-0.12.x.x`, `text-2.1.x`, `aeson-2.2.x.x`, `megaparsec-9.6.x` + # 0.2.0.3 - [bugfix] When a query times out, its context is no longer removed from the Stack diff --git a/nri-redis/nri-redis.cabal b/nri-redis/nri-redis.cabal index a1ef207f..abf7fa87 100644 --- a/nri-redis/nri-redis.cabal +++ b/nri-redis/nri-redis.cabal @@ -1,11 +1,11 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.36.0. +-- This file has been generated from package.yaml by hpack version 0.36.1. -- -- see: https://github.com/sol/hpack name: nri-redis -version: 0.2.0.3 +version: 0.3.0.0 synopsis: An intuitive hedis wrapper library. description: Please see the README at . category: Web @@ -63,25 +63,25 @@ library TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fno-warn-type-defaults -fplugin=NriPrelude.Plugin build-depends: - aeson >=2.0 && <2.2 + aeson >=2.0 && <2.3 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , conduit >=1.3.0 && <1.4 , containers >=0.6.0.1 && <0.7 , cryptohash-sha1 >=0.11.101.0 && <0.12 , haskell-src-meta >=0.8.12 && <0.9 , hedis >=0.14.0 && <0.16 - , megaparsec >=9.2.2 && <9.6 + , megaparsec >=9.2.2 && <9.7 , modern-uri >=0.3.1.0 && <0.4 - , nri-env-parser >=0.1.0.0 && <0.3 - , nri-observability >=0.1.0 && <0.3 + , nri-env-parser >=0.1.0.0 && <0.4 + , nri-observability >=0.1.0 && <0.4 , nri-prelude >=0.1.0.0 && <0.7 , pcre-light >=0.4.1.0 && <0.4.2 , resourcet >=1.2.0 && <1.4 , safe-exceptions >=0.1.7.0 && <1.3 , template-haskell >=2.16 && <3.0 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 , unordered-containers >=0.2.0.0 && <0.3 , uuid >=1.3.0 && <1.4 default-language: Haskell2010 @@ -128,25 +128,25 @@ test-suite tests TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fno-warn-type-defaults -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -fno-warn-type-defaults build-depends: - aeson >=2.0 && <2.2 + aeson >=2.0 && <2.3 , async >=2.2.2 && <2.3 - , base >=4.16.4.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , conduit >=1.3.0 && <1.4 , containers >=0.6.0.1 && <0.7 , cryptohash-sha1 >=0.11.101.0 && <0.12 , haskell-src-meta >=0.8.12 && <0.9 , hedis >=0.14.0 && <0.16 - , megaparsec >=9.2.2 && <9.6 + , megaparsec >=9.2.2 && <9.7 , modern-uri >=0.3.1.0 && <0.4 - , nri-env-parser >=0.1.0.0 && <0.3 - , nri-observability >=0.1.0 && <0.3 + , nri-env-parser >=0.1.0.0 && <0.4 + , nri-observability >=0.1.0 && <0.4 , nri-prelude >=0.1.0.0 && <0.7 , pcre-light >=0.4.1.0 && <0.4.2 , resourcet >=1.2.0 && <1.4 , safe-exceptions >=0.1.7.0 && <1.3 , template-haskell >=2.16 && <3.0 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 , unordered-containers >=0.2.0.0 && <0.3 , uuid >=1.3.0 && <1.4 default-language: Haskell2010 diff --git a/nri-redis/package.yaml b/nri-redis/package.yaml index 87144e8c..b8f6d40f 100644 --- a/nri-redis/package.yaml +++ b/nri-redis/package.yaml @@ -3,7 +3,7 @@ synopsis: An intuitive hedis wrapper library. description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-redis#readme author: NoRedInk -version: 0.2.0.3 +version: 0.3.0.0 maintainer: haskell-open-source@noredink.com copyright: 2024 NoRedInk Corp. github: NoRedInk/haskell-libraries/nri-redis @@ -14,25 +14,25 @@ extra-doc-files: - LICENSE - CHANGELOG.md dependencies: - - aeson >= 2.0 && < 2.2 + - aeson >= 2.0 && < 2.3 - async >=2.2.2 && <2.3 - - base >= 4.16.4.0 && < 4.19 - - bytestring >= 0.10.8.2 && < 0.12 + - base >= 4.17 && < 4.20 + - bytestring >= 0.10.8.2 && < 0.13 - conduit >= 1.3.0 && < 1.4 - containers >= 0.6.0.1 && < 0.7 - cryptohash-sha1 >= 0.11.101.0 && < 0.12 - haskell-src-meta >= 0.8.12 && < 0.9 # hedis 14 introduces redis-cluster support - hedis >= 0.14.0 && < 0.16 - - megaparsec >= 9.2.2 && < 9.6 + - megaparsec >= 9.2.2 && < 9.7 - modern-uri >= 0.3.1.0 && < 0.4 - - nri-env-parser >= 0.1.0.0 && < 0.3 - - nri-observability >= 0.1.0 && < 0.3 + - nri-env-parser >= 0.1.0.0 && < 0.4 + - nri-observability >= 0.1.0 && < 0.4 - nri-prelude >= 0.1.0.0 && < 0.7 - pcre-light >= 0.4.1.0 && < 0.4.2 - resourcet >= 1.2.0 && < 1.4 - safe-exceptions >= 0.1.7.0 && < 1.3 - - text >= 1.2.3.1 && < 2.1 + - text >= 1.2.3.1 && < 2.2 - template-haskell >= 2.16 && < 3.0 - unordered-containers >=0.2.0.0 && <0.3 - uuid >=1.3.0 && < 1.4 diff --git a/nri-redis/src/NonEmptyDict.hs b/nri-redis/src/NonEmptyDict.hs index 199ab408..292a9389 100644 --- a/nri-redis/src/NonEmptyDict.hs +++ b/nri-redis/src/NonEmptyDict.hs @@ -20,14 +20,14 @@ data NonEmptyDict k v deriving (Show) -- | tries to create a 'NonEmptyDict' from a 'Dict' -fromDict :: Ord k => Dict.Dict k v -> Maybe (NonEmptyDict k v) +fromDict :: (Ord k) => Dict.Dict k v -> Maybe (NonEmptyDict k v) fromDict dict = case Dict.toList dict of [] -> Nothing (k, v) : _ -> Just <| init k v dict -- | creates a 'Dict' from a 'NonEmptyDict' -toDict :: Ord k => NonEmptyDict k v -> Dict k v +toDict :: (Ord k) => NonEmptyDict k v -> Dict k v toDict (NonEmptyDict (k, v) dict) = Dict.insert k v dict @@ -37,6 +37,6 @@ toNonEmptyList (NonEmptyDict kv dict) = kv :| Dict.toList dict -- | creates a `NonEmptyDict` from a key, value, and dict -init :: Ord k => k -> v -> Dict.Dict k v -> NonEmptyDict k v +init :: (Ord k) => k -> v -> Dict.Dict k v -> NonEmptyDict k v init key val dict = NonEmptyDict (key, val) (Dict.remove key dict) diff --git a/nri-redis/src/Redis/Codec.hs b/nri-redis/src/Redis/Codec.hs index 49c0e862..5d7a3b6a 100644 --- a/nri-redis/src/Redis/Codec.hs +++ b/nri-redis/src/Redis/Codec.hs @@ -21,10 +21,10 @@ type Decoder a = ByteString -> Result Internal.Error a jsonCodec :: (Aeson.FromJSON a, Aeson.ToJSON a) => Codec a jsonCodec = Codec jsonEncoder jsonDecoder -jsonEncoder :: Aeson.ToJSON a => Encoder a +jsonEncoder :: (Aeson.ToJSON a) => Encoder a jsonEncoder = Aeson.encode >> Data.ByteString.Lazy.toStrict -jsonDecoder :: Aeson.FromJSON a => Decoder a +jsonDecoder :: (Aeson.FromJSON a) => Decoder a jsonDecoder byteString = case Aeson.eitherDecodeStrict' byteString of Prelude.Right decoded -> Ok decoded diff --git a/nri-redis/src/Redis/Hash.hs b/nri-redis/src/Redis/Hash.hs index be014d54..a2bd0ee1 100644 --- a/nri-redis/src/Redis/Hash.hs +++ b/nri-redis/src/Redis/Hash.hs @@ -153,7 +153,7 @@ jsonApi = makeApi Codec.jsonCodec -- | Creates a Redis API mapping a 'key' to Text textApi :: - Ord field => + (Ord field) => (key -> Text) -> (field -> Text) -> (Text -> Maybe field) -> @@ -162,7 +162,7 @@ textApi = makeApi Codec.textCodec -- | Creates a Redis API mapping a 'key' to a ByteString byteStringApi :: - Ord field => + (Ord field) => (key -> Text) -> (field -> Text) -> (Text -> Maybe field) -> @@ -170,7 +170,7 @@ byteStringApi :: byteStringApi = makeApi Codec.byteStringCodec makeApi :: - Ord field => + (Ord field) => Codec.Codec a -> (key -> Text) -> (field -> Text) -> @@ -211,7 +211,7 @@ makeApi Codec.Codec {Codec.codecEncoder, Codec.codecDecoder} toKey toField fromF Internal.Hsetnx (toKey key) (toField field) (codecEncoder val) } -toDict :: Ord field => (Text -> Maybe field) -> Codec.Decoder a -> List (Text, ByteString) -> Result Internal.Error (Dict.Dict field a) +toDict :: (Ord field) => (Text -> Maybe field) -> Codec.Decoder a -> List (Text, ByteString) -> Result Internal.Error (Dict.Dict field a) toDict fromField decode = Result.map Dict.fromList << Prelude.traverse diff --git a/nri-redis/src/Redis/Script.hs b/nri-redis/src/Redis/Script.hs index 88a1d16a..de759128 100644 --- a/nri-redis/src/Redis/Script.hs +++ b/nri-redis/src/Redis/Script.hs @@ -70,7 +70,7 @@ instance {-# INCOHERENT #-} HasScriptParam ScriptParam where -- -- It is what forces us to hav UndecidableInstances enabled. instance - GHC.TypeLits.TypeError ('GHC.TypeLits.Text "[script| ${..} ] interpolation only supports Key or Literal inputs.") => + (GHC.TypeLits.TypeError ('GHC.TypeLits.Text "[script| ${..} ] interpolation only supports Key or Literal inputs.")) => HasScriptParam x where getScriptParam = Prelude.error "This won't ever hit bc this generates a compile-time error." @@ -129,7 +129,7 @@ toEvaluatedToken token = ScriptText text -> [|EvaluatedText text|] ScriptVariable var -> pure <| (TH.VarE 'evaluateScriptParam) `TH.AppE` (varToExp var) -evaluateScriptParam :: HasScriptParam a => a -> EvaluatedToken +evaluateScriptParam :: (HasScriptParam a) => a -> EvaluatedToken evaluateScriptParam scriptParam = case getScriptParam scriptParam of Key a -> diff --git a/nri-redis/src/Redis/Set.hs b/nri-redis/src/Redis/Set.hs index d122ec29..ca6f4c1e 100644 --- a/nri-redis/src/Redis/Set.hs +++ b/nri-redis/src/Redis/Set.hs @@ -134,7 +134,7 @@ byteStringApi :: (key -> Text) -> Api key ByteString.ByteString byteStringApi = makeApi Codec.byteStringCodec makeApi :: - Ord a => + (Ord a) => Codec.Codec a -> (key -> Text) -> Api key a @@ -154,7 +154,6 @@ makeApi Codec.Codec {Codec.codecEncoder, Codec.codecDecoder} toKey = Internal.Smembers (toKey key) |> Internal.WithResult (Prelude.traverse codecDecoder) |> Internal.map Set.fromList, - sismember = \key val-> - Internal.Sismember (toKey key) (codecEncoder val) - + sismember = \key val -> + Internal.Sismember (toKey key) (codecEncoder val) } diff --git a/nri-redis/src/Redis/SortedSet.hs b/nri-redis/src/Redis/SortedSet.hs index 3489459c..528c7c06 100644 --- a/nri-redis/src/Redis/SortedSet.hs +++ b/nri-redis/src/Redis/SortedSet.hs @@ -138,7 +138,7 @@ byteStringApi :: (key -> Text) -> Api key ByteString.ByteString byteStringApi = makeApi Codec.byteStringCodec makeApi :: - Ord a => + (Ord a) => Codec.Codec a -> (key -> Text) -> Api key a diff --git a/nri-redis/test/Helpers.hs b/nri-redis/test/Helpers.hs index 9b939ebc..5b4841f6 100644 --- a/nri-redis/test/Helpers.hs +++ b/nri-redis/test/Helpers.hs @@ -37,4 +37,4 @@ getHandlers = do -- -- We keep this here in case similar is true in later versions of GHC. goldenResultsDir :: Text -goldenResultsDir = "test/golden-results-9.2" +goldenResultsDir = "test/golden-results-9.8" diff --git a/nri-redis/test/Spec/Settings.hs b/nri-redis/test/Spec/Settings.hs index c62d3178..1add2547 100644 --- a/nri-redis/test/Spec/Settings.hs +++ b/nri-redis/test/Spec/Settings.hs @@ -21,7 +21,7 @@ tests = -- -- We lean on `show` for equality since `Database.Redis.ConnectInfo` doesn't have -- an `Eq` instance (but does have a `Show` instance) -expectEqualShow :: Show a => a -> a -> Expect.Expectation +expectEqualShow :: (Show a) => a -> a -> Expect.Expectation expectEqualShow x y = Expect.equal (show x) (show y) decoderTests :: Test.Test diff --git a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-counter-query b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-counter-query similarity index 91% rename from nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-counter-query rename to nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-counter-query index 9d26f213..971eaef8 100644 --- a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-counter-query +++ b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-counter-query @@ -6,7 +6,7 @@ TracingSpan Just ( "rootTracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 31 @@ -29,7 +29,7 @@ TracingSpan Just ( "query" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 123 diff --git a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-counter-transaction b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-counter-transaction similarity index 91% rename from nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-counter-transaction rename to nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-counter-transaction index 2acc570f..8da1738f 100644 --- a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-counter-transaction +++ b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-counter-transaction @@ -6,7 +6,7 @@ TracingSpan Just ( "rootTracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 31 @@ -29,7 +29,7 @@ TracingSpan Just ( "transaction" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 130 diff --git a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-hash-query b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-hash-query similarity index 91% rename from nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-hash-query rename to nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-hash-query index 9e16b514..1657f87f 100644 --- a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-hash-query +++ b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-hash-query @@ -6,7 +6,7 @@ TracingSpan Just ( "rootTracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 31 @@ -29,7 +29,7 @@ TracingSpan Just ( "query" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 95 diff --git a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-hash-transaction b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-hash-transaction similarity index 91% rename from nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-hash-transaction rename to nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-hash-transaction index c982e8af..79470d9e 100644 --- a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-hash-transaction +++ b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-hash-transaction @@ -6,7 +6,7 @@ TracingSpan Just ( "rootTracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 31 @@ -29,7 +29,7 @@ TracingSpan Just ( "transaction" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 102 diff --git a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-list-query b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-list-query similarity index 91% rename from nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-list-query rename to nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-list-query index 346d1b34..059852cc 100644 --- a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-list-query +++ b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-list-query @@ -6,7 +6,7 @@ TracingSpan Just ( "rootTracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 31 @@ -29,7 +29,7 @@ TracingSpan Just ( "query" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 109 diff --git a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-list-transaction b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-list-transaction similarity index 91% rename from nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-list-transaction rename to nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-list-transaction index 9ac8b860..58fbd62a 100644 --- a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-list-transaction +++ b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-list-transaction @@ -6,7 +6,7 @@ TracingSpan Just ( "rootTracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 31 @@ -29,7 +29,7 @@ TracingSpan Just ( "transaction" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 116 diff --git a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-query b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-query similarity index 91% rename from nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-query rename to nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-query index cc957cbd..25f49aee 100644 --- a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-query +++ b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-query @@ -6,7 +6,7 @@ TracingSpan Just ( "rootTracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 31 @@ -29,7 +29,7 @@ TracingSpan Just ( "query" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 81 diff --git a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-query-timeout b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-query-timeout similarity index 91% rename from nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-query-timeout rename to nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-query-timeout index e4be0b2d..e9155def 100644 --- a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-query-timeout +++ b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-query-timeout @@ -6,7 +6,7 @@ TracingSpan Just ( "rootTracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 47 @@ -29,7 +29,7 @@ TracingSpan Just ( "query" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 140 diff --git a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-transaction b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-transaction similarity index 91% rename from nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-transaction rename to nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-transaction index 9f05d700..45e4f4d8 100644 --- a/nri-redis/test/golden-results-9.2/observability-spec-reporting-redis-transaction +++ b/nri-redis/test/golden-results-9.8/observability-spec-reporting-redis-transaction @@ -6,7 +6,7 @@ TracingSpan Just ( "rootTracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 31 @@ -29,7 +29,7 @@ TracingSpan Just ( "transaction" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 88 diff --git a/nri-redis/test/golden-results-9.2/observability-spec-reporting-with-query-timout b/nri-redis/test/golden-results-9.8/observability-spec-reporting-with-query-timout similarity index 91% rename from nri-redis/test/golden-results-9.2/observability-spec-reporting-with-query-timout rename to nri-redis/test/golden-results-9.8/observability-spec-reporting-with-query-timout index 41dbd3ff..d44dfbd4 100644 --- a/nri-redis/test/golden-results-9.2/observability-spec-reporting-with-query-timout +++ b/nri-redis/test/golden-results-9.8/observability-spec-reporting-with-query-timout @@ -6,7 +6,7 @@ TracingSpan Just ( "rootTracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 31 @@ -29,7 +29,7 @@ TracingSpan Just ( "withContext" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Redis.Handler" , srcLocFile = "src/Redis/Handler.hs" , srcLocStartLine = 68 diff --git a/nri-redis/test/golden-results-9.2/observability-spec-reporting-without-query-timout b/nri-redis/test/golden-results-9.8/observability-spec-reporting-without-query-timout similarity index 91% rename from nri-redis/test/golden-results-9.2/observability-spec-reporting-without-query-timout rename to nri-redis/test/golden-results-9.8/observability-spec-reporting-without-query-timout index 485ba35a..b65f02d5 100644 --- a/nri-redis/test/golden-results-9.2/observability-spec-reporting-without-query-timout +++ b/nri-redis/test/golden-results-9.8/observability-spec-reporting-without-query-timout @@ -6,7 +6,7 @@ TracingSpan Just ( "rootTracingSpanIO" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Spec.Redis" , srcLocFile = "test/Spec/Redis.hs" , srcLocStartLine = 31 @@ -29,7 +29,7 @@ TracingSpan Just ( "withContext" , SrcLoc - { srcLocPackage = "main" + { srcLocPackage = "nri-redis-0.3.0.0-inplace-tests" , srcLocModule = "Redis.Handler" , srcLocFile = "src/Redis/Handler.hs" , srcLocStartLine = 75 diff --git a/nri-test-encoding/CHANGELOG.md b/nri-test-encoding/CHANGELOG.md index b46ee050..c4a6ccd4 100644 --- a/nri-test-encoding/CHANGELOG.md +++ b/nri-test-encoding/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.3.0.0 + +- Drop support for GHC 9.2.x +- Support GHC 9.8.3, `bytestring-0.12.x.x`, `text-2.1.x`, `aeson-2.2.x.x` + # 0.2.0.1 - Drop support for `aeson-1.x` diff --git a/nri-test-encoding/nri-test-encoding.cabal b/nri-test-encoding/nri-test-encoding.cabal index 1442dcee..57ca15b9 100644 --- a/nri-test-encoding/nri-test-encoding.cabal +++ b/nri-test-encoding/nri-test-encoding.cabal @@ -1,11 +1,11 @@ cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.36.0. +-- This file has been generated from package.yaml by hpack version 0.36.1. -- -- see: https://github.com/sol/hpack name: nri-test-encoding -version: 0.2.0.1 +version: 0.3.0.0 synopsis: A library to simplify writing golden tests for encoding types. description: Please see the README at . category: Testing @@ -53,17 +53,17 @@ library TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin build-depends: - aeson >=2.0 && <2.2 + aeson >=2.0 && <2.3 , aeson-pretty >=0.8.0 && <0.9 - , base >=4.16.4.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , filepath >=1.4.2.1 && <1.5 , nri-prelude >=0.1.0.0 && <0.7 - , nri-redis >=0.1.0.0 && <0.3 + , nri-redis >=0.1.0.0 && <0.4 , servant >=0.16.2 && <0.21 , servant-auth-server >=0.4.5.1 && <0.5 , servant-server >=0.16.2 && <0.21 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 default-language: Haskell2010 test-suite tests @@ -94,15 +94,15 @@ test-suite tests TypeOperators ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wpartial-fields -Wredundant-constraints -Wincomplete-uni-patterns -fplugin=NriPrelude.Plugin -threaded -rtsopts "-with-rtsopts=-N -T" -fno-warn-type-defaults build-depends: - aeson >=2.0 && <2.2 + aeson >=2.0 && <2.3 , aeson-pretty >=0.8.0 && <0.9 - , base >=4.16.4.0 && <4.19 - , bytestring >=0.10.8.2 && <0.12 + , base >=4.17 && <4.20 + , bytestring >=0.10.8.2 && <0.13 , filepath >=1.4.2.1 && <1.5 , nri-prelude >=0.1.0.0 && <0.7 - , nri-redis >=0.1.0.0 && <0.3 + , nri-redis >=0.1.0.0 && <0.4 , servant >=0.16.2 && <0.21 , servant-auth-server >=0.4.5.1 && <0.5 , servant-server >=0.16.2 && <0.21 - , text >=1.2.3.1 && <2.1 + , text >=1.2.3.1 && <2.2 default-language: Haskell2010 diff --git a/nri-test-encoding/package.yaml b/nri-test-encoding/package.yaml index cf3a1b4b..c49e5157 100644 --- a/nri-test-encoding/package.yaml +++ b/nri-test-encoding/package.yaml @@ -3,7 +3,7 @@ synopsis: A library to simplify writing golden tests for encoding types. description: Please see the README at . homepage: https://github.com/NoRedInk/haskell-libraries/tree/trunk/nri-test-encoding#readme author: NoRedInk -version: 0.2.0.1 +version: 0.3.0.0 maintainer: haskell-open-source@noredink.com copyright: 2024 NoRedInk Corp. github: NoRedInk/haskell-libraries/nri-test-encoding @@ -14,17 +14,17 @@ extra-doc-files: - LICENSE - CHANGELOG.md dependencies: - - aeson >= 2.0 && < 2.2 + - aeson >= 2.0 && < 2.3 - aeson-pretty >=0.8.0 && < 0.9 - - base >= 4.16.4.0 && < 4.19 - - bytestring >= 0.10.8.2 && < 0.12 + - base >= 4.17 && < 4.20 + - bytestring >= 0.10.8.2 && < 0.13 - filepath >= 1.4.2.1 && < 1.5 - servant >= 0.16.2 && < 0.21 - servant-auth-server >= 0.4.5.1 && < 0.5 - servant-server >= 0.16.2 && < 0.21 - - text >= 1.2.3.1 && < 2.1 + - text >= 1.2.3.1 && < 2.2 - nri-prelude >= 0.1.0.0 && < 0.7 - - nri-redis >= 0.1.0.0 && < 0.3 + - nri-redis >= 0.1.0.0 && < 0.4 library: exposed-modules: - Examples diff --git a/nri-test-encoding/src/Examples.hs b/nri-test-encoding/src/Examples.hs index 1a9efcd7..82f74d0f 100644 --- a/nri-test-encoding/src/Examples.hs +++ b/nri-test-encoding/src/Examples.hs @@ -36,7 +36,7 @@ data Example = Example -- | Create an example for a type. Examples consists of a description and an -- encoded value. -example :: Data.Aeson.ToJSON a => Text -> a -> Examples +example :: (Data.Aeson.ToJSON a) => Text -> a -> Examples example description x = Example { description, diff --git a/nri-test-encoding/src/Test/Encoding.hs b/nri-test-encoding/src/Test/Encoding.hs index 415ffff1..3c5f2beb 100644 --- a/nri-test-encoding/src/Test/Encoding.hs +++ b/nri-test-encoding/src/Test/Encoding.hs @@ -11,12 +11,14 @@ import Test (Test, test) import qualified Text -- | Creates tests for some examples -examplesToTest :: Stack.HasCallStack => Text -> Text -> Examples.Examples -> Test +examplesToTest :: (Stack.HasCallStack) => Text -> Text -> Examples.Examples -> Test examplesToTest name fileName examples = test name <| \() -> Expect.equalToContentsOf - ( "test" "golden-results" Text.toList fileName - |> FilePath.makeValid - |> Text.fromList + ( "test" + "golden-results" + Text.toList fileName + |> FilePath.makeValid + |> Text.fromList ) (Examples.render examples) diff --git a/nri-test-encoding/src/Test/Encoding/Redis.hs b/nri-test-encoding/src/Test/Encoding/Redis.hs index 6321159f..18aa66b3 100644 --- a/nri-test-encoding/src/Test/Encoding/Redis.hs +++ b/nri-test-encoding/src/Test/Encoding/Redis.hs @@ -33,7 +33,9 @@ frozenTest _ = Typeable.typeRep proxy |> Typeable.typeRepTyCon typeName = - Typeable.tyConModule tyCon ++ "." ++ Typeable.tyConName tyCon + Typeable.tyConModule tyCon + ++ "." + ++ Typeable.tyConName tyCon |> Text.fromList in Examples.examples proxy |> Test.Encoding.examplesToTest typeName ("redis-encoding-" ++ typeName) diff --git a/shell-ghc-9-2.nix b/shell-ghc-9-8.nix similarity index 79% rename from shell-ghc-9-2.nix rename to shell-ghc-9-8.nix index 06f5cc47..369885a1 100644 --- a/shell-ghc-9-2.nix +++ b/shell-ghc-9-8.nix @@ -4,5 +4,5 @@ let commonHaskellOverrides = import ./nix/common-haskell-overrides.nix { inherit sources pkgs; }; in import nix/mk-shell.nix { pkgs = pkgs; - haskellPackages = pkgs.haskell.packages.ghc928.extend commonHaskellOverrides; + haskellPackages = pkgs.haskell.packages.ghc983.extend commonHaskellOverrides; } diff --git a/shell.nix b/shell.nix index 25006034..48bfdae1 120000 --- a/shell.nix +++ b/shell.nix @@ -1 +1 @@ -shell-ghc-9-6.nix \ No newline at end of file +shell-ghc-9-8.nix \ No newline at end of file