I'm using 0.6.0.0 with GHC 7.4.1 on Linux x86_64.
Here's a very basic 'encode' + 'decode' chain that fails:
import Data.Aeson.Generic (decode, encode)
import qualified Data.Map as Map
import Data.Map (Map)
type SomeType = Map String (Maybe String)
main :: IO ()
main = do
let x = ((Map.fromList [("x", Nothing)]) :: SomeType)
let y = (decode (encode x) :: Maybe SomeType)
if (Just x /= y) then
Also, in 0.5.0.0 this problem is not there, so I guess it has something to do with the changes from 0.5.0.0 to 0.6.0.0.
Broken by 49befca - I'm investigating this right now
@basvandijk - this looks like something you might know about?
Add a test case for gh-72
Sometimes, it appears, Nullary constructors can be encoded as Null as
well as an empty array [not sure why one this!]. The Generic code, as of
49befca, fails when a Null is
passed for a nullary constructor. Add in a pattern match to fix this