hpack-convert
hpack-convert copied to clipboard
hpack-convert fails to build with GHC-8.2.1 and Cabal-2.0
First some warnings (GHC's memory usage really blows up here):
[ 7 of 12] Compiling Hpack.Config ( src/Hpack/Config.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.0.2/build/Hpack/Config.o )
/tmp/stack31554/hpack-convert-1.0.1/src/Hpack/Config.hs:122:19: warning: [-Wsimplifiable-class-constraints]
• The constraint ‘HasTypeName a’ matches an instance declaration
instance [safe] (GHC.Generics.Datatype d, Generic a,
Rep a ~ GHC.Generics.M1 GHC.Generics.D d m) =>
HasTypeName a
-- Defined at src/Hpack/GenericsUtil.hs:21:10
This makes type inference for inner bindings fragile;
either use MonoLocalBinds, or simplify it using the instance
• In the type signature:
genericToJSON_ :: forall a.
(Generic a, GToJSON Zero (Rep a), HasTypeName a) => a -> Value
|
122 | genericToJSON_ :: forall a. (Generic a, GToJSON Zero (Rep a), HasTypeName a) => a -> Value
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/tmp/stack31554/hpack-convert-1.0.1/src/Hpack/Config.hs:143:22: warning: [-Wsimplifiable-class-constraints]
• The constraint ‘HasTypeName a’ matches an instance declaration
instance [safe] (GHC.Generics.Datatype d, Generic a,
Rep a ~ GHC.Generics.M1 GHC.Generics.D d m) =>
HasTypeName a
-- Defined at src/Hpack/GenericsUtil.hs:21:10
This makes type inference for inner bindings fragile;
either use MonoLocalBinds, or simplify it using the instance
• In the type signature:
genericParseJSON_ :: forall a.
(Generic a, GFromJSON Zero (Rep a), HasTypeName a) =>
Value -> Parser a
|
143 | genericParseJSON_ :: forall a. (Generic a, GFromJSON Zero (Rep a), HasTypeName a) => Value -> Parser a
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/tmp/stack31554/hpack-convert-1.0.1/src/Hpack/Config.hs:166:11: warning: [-Wsimplifiable-class-constraints]
• The constraint ‘HasTypeName a’ matches an instance declaration
instance [safe] (GHC.Generics.Datatype d, Generic a,
Rep a ~ GHC.Generics.M1 GHC.Generics.D d m) =>
HasTypeName a
-- Defined at src/Hpack/GenericsUtil.hs:21:10
This makes type inference for inner bindings fragile;
either use MonoLocalBinds, or simplify it using the instance
• When checking the class method:
fieldNames :: forall a. HasFieldNames a => Proxy a -> [FieldName]
In the class declaration for ‘HasFieldNames’
|
166 | default fieldNames :: (HasTypeName a, Selectors (Rep a)) => Proxy a -> [String]
| ^^^^^^^^^^
/tmp/stack31554/hpack-convert-1.0.1/src/Hpack/Config.hs:503:10: warning: [-Wsimplifiable-class-constraints]
• The constraint ‘HasTypeName (Section a)’
matches an instance declaration
instance [safe] (GHC.Generics.Datatype d, Generic a,
Rep a ~ GHC.Generics.M1 GHC.Generics.D d m) =>
HasTypeName a
-- Defined at src/Hpack/GenericsUtil.hs:21:10
This makes type inference for inner bindings fragile;
either use MonoLocalBinds, or simplify it using the instance
• In the context: (Generic (Section a),
GToJSON Zero (Rep (Section a)), HasTypeName (Section a), ToJSON a)
While checking an instance declaration
In the instance declaration for ‘ToJSON (Section a)’
|
503 | instance (Generic (Section a), GToJSON Zero (Rep (Section a)), HasTypeName (Section a),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
Then the compile failure:
[ 9 of 12] Compiling Hpack.Convert ( src/Hpack/Convert.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.0.2/build/Hpack/Convert.o )
/tmp/stack31554/hpack-convert-1.0.1/src/Hpack/Convert.hs:52:34: error:
Not in scope: data constructor ‘Cabal.FlagName’
Perhaps you meant one of these:
variable ‘Cabal.flagName’ (imported from Distribution.PackageDescription),
variable ‘Cabal.mkFlagName’ (imported from Distribution.PackageDescription),
variable ‘Cabal.unFlagName’ (imported from Distribution.PackageDescription)
Neither ‘Distribution.InstalledPackageInfo’, ‘Distribution.Package’, ‘Distribution.PackageDescription’, ‘Distribution.PackageDescription.Parse’, ‘Distribution.Text’ nor ‘Distribution.Version’ exports ‘FlagName’.
|
52 | let Cabal.FlagName fn = flagName
| ^^^^^^^^^^^^^^
/tmp/stack31554/hpack-convert-1.0.1/src/Hpack/Convert.hs:183:17: error:
Not in scope: data constructor ‘Cabal.FlagName’
Perhaps you meant one of these:
variable ‘Cabal.flagName’ (imported from Distribution.PackageDescription),
variable ‘Cabal.mkFlagName’ (imported from Distribution.PackageDescription),
variable ‘Cabal.unFlagName’ (imported from Distribution.PackageDescription)
Neither ‘Distribution.InstalledPackageInfo’, ‘Distribution.Package’, ‘Distribution.PackageDescription’, ‘Distribution.PackageDescription.Parse’, ‘Distribution.Text’ nor ‘Distribution.Version’ exports ‘FlagName’.
|
183 | Cabal.Flag (Cabal.FlagName fl) -> "flag(" ++ fl ++ ")"
| ^^^^^^^^^^^^^^