Skip to content

Fix warnings revealed by PureScript v0.14.1 #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ New features:
Bugfixes:

Other improvements:
- Removed unused names found by the v0.14.1 PureScript release (#36)
- Installed dependencies directly imported into source code that were previously installed transitively and removed unused `record` dependency (#36)

## [v7.0.0](https://github.com/purescript-contrib/purescript-argonaut-generic/releases/tag/v7.0.0) - 2021-02-26

Expand Down
8 changes: 7 additions & 1 deletion spago.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
, dependencies =
[ "argonaut-codecs"
, "argonaut-core"
, "arrays"
, "assert"
, "bifunctors"
, "console"
, "control"
, "effect"
, "either"
, "exceptions"
, "foreign-object"
, "partial"
, "prelude"
, "psci-support"
, "record"
, "strings"
]
, packages = ./packages.dhall
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
Expand Down
8 changes: 4 additions & 4 deletions src/Data/Argonaut/Decode/Generic.purs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ decodeRep :: forall r. DecodeRep r => Json -> Either JsonDecodeError r
decodeRep = decodeRepWith defaultEncoding

instance decodeRepNoConstructors :: DecodeRep Rep.NoConstructors where
decodeRepWith e _ = Left $ UnexpectedValue $ fromString "NoConstructors (Cannot decode empty data type)"
decodeRepWith _ _ = Left $ UnexpectedValue $ fromString "NoConstructors (Cannot decode empty data type)"

instance decodeRepSum :: (DecodeRep a, DecodeRep b) => DecodeRep (Rep.Sum a b) where
decodeRepWith e j = Rep.Inl <$> decodeRepWith e j <|> Rep.Inr <$> decodeRepWith e j
Expand Down Expand Up @@ -88,13 +88,13 @@ construct e valuesArray decodingErr = do
instance decodeRepConstructorNoArgs :: IsSymbol name => DecodeRep (Rep.Constructor name Rep.NoArguments) where
decodeRepWith e j = do
let name = reflectSymbol (Proxy :: Proxy name)
{tag, decodingErr} <- withTag e j name
{decodingErr} <- withTag e j name
construct e [] decodingErr
else
instance decodeRepConstructorArg :: (IsSymbol name, DecodeJson a) => DecodeRep (Rep.Constructor name (Rep.Argument a)) where
decodeRepWith e j = do
let name = reflectSymbol (Proxy :: Proxy name)
{tag, values, decodingErr} <- withTagAndValues e j name
{values, decodingErr} <- withTagAndValues e j name
if e.unwrapSingleArguments
then construct e [values] decodingErr
else do
Expand All @@ -104,7 +104,7 @@ else
instance decodeRepConstructor :: (IsSymbol name, DecodeRepArgs a) => DecodeRep (Rep.Constructor name a) where
decodeRepWith e j = do
let name = reflectSymbol (Proxy :: Proxy name)
{tag, values, decodingErr} <- withTagAndValues e j name
{values, decodingErr} <- withTagAndValues e j name
valuesArray <- note (decodingErr $ AtKey e.valuesKey $ TypeMismatch "Array") (toArray values)
construct e valuesArray decodingErr

Expand Down