From 52be16127a3a4e3ceac49d83afaef270b5cfcbf3 Mon Sep 17 00:00:00 2001 From: iphydf Date: Fri, 1 Sep 2023 18:19:08 +0000 Subject: [PATCH 1/2] chore: Upgrade stack LTS snapshot to 21.9 (GHC 9.4.6). --- BUILD.bazel | 2 +- msgpack-types.cabal | 6 +++--- src/Data/MessagePack/Types/Generic.hs | 3 ++- stack.yaml | 4 ++-- test/Data/MessagePack/Types/ClassSpec.hs | 3 ++- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 8917086..6931f0d 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -9,7 +9,7 @@ haskell_library( name = "hs-msgpack-types", srcs = glob(["src/**/*.*hs"]), src_strip_prefix = "src", - version = "0.3.2", + version = "0.3.3", visibility = ["//visibility:public"], deps = [ hazel_library("base"), diff --git a/msgpack-types.cabal b/msgpack-types.cabal index 61df035..c11348b 100644 --- a/msgpack-types.cabal +++ b/msgpack-types.cabal @@ -1,5 +1,5 @@ name: msgpack-types -version: 0.3.2 +version: 0.3.3 synopsis: A Haskell implementation of MessagePack. homepage: http://msgpack.org/ license: BSD3 @@ -28,7 +28,7 @@ library src ghc-options: -Wall - -fno-warn-unused-imports + -Wno-unused-imports exposed-modules: Data.MessagePack.Tags Data.MessagePack.Types @@ -62,7 +62,7 @@ test-suite testsuite Test.QuickCheck.Instances.MessagePack ghc-options: -Wall - -fno-warn-unused-imports + -Wno-unused-imports build-tool-depends: hspec-discover:hspec-discover build-depends: diff --git a/src/Data/MessagePack/Types/Generic.hs b/src/Data/MessagePack/Types/Generic.hs index edbadca..acb3da3 100644 --- a/src/Data/MessagePack/Types/Generic.hs +++ b/src/Data/MessagePack/Types/Generic.hs @@ -17,6 +17,7 @@ import Control.Monad.Trans.State.Strict (StateT, evalStateT, get, put) import Control.Monad.Validate (MonadValidate, refute) import Data.Bits (shiftR) +import Data.Kind (Type) import Data.Word (Word64) import GHC.Generics @@ -156,7 +157,7 @@ instance GMessagePack a => GSumPack (C1 c a) where class SumSize f where sumSize :: Tagged f Word64 -newtype Tagged (s :: * -> *) b = Tagged { unTagged :: b } +newtype Tagged (s :: Type -> Type) b = Tagged { unTagged :: b } instance (SumSize a, SumSize b) => SumSize (a :+: b) where sumSize = Tagged $ unTagged (sumSize :: Tagged a Word64) + unTagged diff --git a/stack.yaml b/stack.yaml index a0fca96..f001d3f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,5 +1,5 @@ --- packages: [.] -resolver: lts-18.18 +resolver: lts-21.9 extra-deps: - - monad-validate-1.2.0.0@sha256:9850f408431098b28806dd464b6825a88a0b56c84f380d7fe0454c1df9d6f881,3505 + - monad-validate-1.3.0.0 diff --git a/test/Data/MessagePack/Types/ClassSpec.hs b/test/Data/MessagePack/Types/ClassSpec.hs index 171fde7..3726d1d 100644 --- a/test/Data/MessagePack/Types/ClassSpec.hs +++ b/test/Data/MessagePack/Types/ClassSpec.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fconstraint-solver-iterations=10 #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} @@ -14,8 +15,8 @@ import Control.Monad.Validate (MonadValidate (..), runValidate) import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as LBS -import qualified Data.HashMap.Strict as HashMap import Data.Hashable (Hashable) +import qualified Data.HashMap.Strict as HashMap import Data.Int (Int16, Int32, Int64, Int8) import qualified Data.IntMap.Strict as IntMap From 6fda9b4f24bc8855efaf498548b6290a4b56e6df Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 1 Sep 2023 18:24:12 +0000 Subject: [PATCH 2/2] Restyled by cabal-fmt --- msgpack-types.cabal | 83 ++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 43 deletions(-) diff --git a/msgpack-types.cabal b/msgpack-types.cabal index c11348b..4a28af3 100644 --- a/msgpack-types.cabal +++ b/msgpack-types.cabal @@ -1,16 +1,16 @@ -name: msgpack-types -version: 0.3.3 -synopsis: A Haskell implementation of MessagePack. -homepage: http://msgpack.org/ -license: BSD3 -license-file: LICENSE -author: Hideyuki Tanaka -maintainer: Iphigenia Df -copyright: Copyright (c) 2009-2016, Hideyuki Tanaka -category: Data -stability: Experimental -cabal-version: >= 1.10 -build-type: Simple +name: msgpack-types +version: 0.3.3 +synopsis: A Haskell implementation of MessagePack. +homepage: http://msgpack.org/ +license: BSD3 +license-file: LICENSE +author: Hideyuki Tanaka +maintainer: Iphigenia Df +copyright: Copyright (c) 2009-2016, Hideyuki Tanaka +category: Data +stability: Experimental +cabal-version: >=1.10 +build-type: Simple description: A Haskell implementation of MessagePack . @@ -19,27 +19,26 @@ description: bugfixes and is actively being developed. source-repository head - type: git - location: https://github.com/TokTok/hs-msgpack-types.git + type: git + location: https://github.com/TokTok/hs-msgpack-types.git library default-language: Haskell2010 - hs-source-dirs: - src - ghc-options: - -Wall - -Wno-unused-imports + hs-source-dirs: src + ghc-options: -Wall -Wno-unused-imports exposed-modules: - Data.MessagePack.Tags - Data.MessagePack.Types + Data.MessagePack.Tags + Data.MessagePack.Types + other-modules: - Data.MessagePack.Types.Assoc - Data.MessagePack.Types.Class - Data.MessagePack.Types.DecodeError - Data.MessagePack.Types.Generic - Data.MessagePack.Types.Object + Data.MessagePack.Types.Assoc + Data.MessagePack.Types.Class + Data.MessagePack.Types.DecodeError + Data.MessagePack.Types.Generic + Data.MessagePack.Types.Object + build-depends: - base < 5 + base <5 , bytestring , containers , deepseq @@ -51,23 +50,20 @@ library , vector test-suite testsuite - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: testsuite.hs + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: test + main-is: testsuite.hs other-modules: - Data.MessagePack.TagsSpec - Data.MessagePack.Types.AssocSpec - Data.MessagePack.Types.ClassSpec - Test.QuickCheck.Instances.MessagePack - ghc-options: - -Wall - -Wno-unused-imports - build-tool-depends: - hspec-discover:hspec-discover + Data.MessagePack.TagsSpec + Data.MessagePack.Types.AssocSpec + Data.MessagePack.Types.ClassSpec + Test.QuickCheck.Instances.MessagePack + + ghc-options: -Wall -Wno-unused-imports + build-tool-depends: hspec-discover:hspec-discover build-depends: - base < 5 - , QuickCheck + base <5 , bytestring , containers , deepseq @@ -76,6 +72,7 @@ test-suite testsuite , hspec , monad-validate , msgpack-types + , QuickCheck , quickcheck-instances , text , unordered-containers