Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #62.

Nullary constructors are encoded as an empty array.
The syb code wrongfully assumed they were encoded as Null.
  • Loading branch information...
commit 49befcafc80a85b371a6e0e0d5ab4ad9b33d8778 1 parent a90437a
@basvandijk basvandijk authored
Showing with 1 addition and 3 deletions.
  1. +1 −3 Data/Aeson/Generic.hs
View
4 Data/Aeson/Generic.hs
@@ -290,10 +290,8 @@ parseJSON_generic j = generic
decodeArgs c0 = go (numConstrArgs (resType generic) c0) c0
(constrFields c0)
where
- go 0 c _ Null = construct c [] -- nullary constructor
go 1 c [] jd = construct c [jd] -- unary constructor
- go n c [] (Array js)
- | n > 1 = construct c (V.toList js) -- no field names
+ go _ c [] (Array js) = construct c (V.toList js) -- no field names
-- FIXME? We could allow reading an array into a constructor
-- with field names.
go _ c fs@(_:_) (Object o) = selectFields o fs >>=

1 comment on commit 49befca

@jhance

This raises #72

Please sign in to comment.
Something went wrong with that request. Please try again.