Help with Data.Aeson json data parsing

Hi, please can you help me with following? I'm trying to parse one json (simplified version below), but I keep getting: "when expecting a record (:*:), encountered Array instead" code: ------------ data SomeData = SomeData { v1 :: Int, v2 :: Int } deriving (Show, Generic) data SomeDataPack = SomeDataPack{ pack :: [SomeData] } deriving (Show, Generic) instance FromJSON SomeData instance FromJSON SomeDataPack parsedata :: IO (Maybe SomeDataPack) parsedata = do let x = "[{\"v1\":11,\"v2\":12},{\"v1\":13,\"v2\":14}]"; case (eitherDecode' x :: Either String SomeDataPack) of Right r -> do putStrLn $ show r return $ Just r Left e -> do putStrLn $ show e return Nothing thanks, m.

On Fri, Jan 3, 2014 at 6:42 PM, Miro Karpis
data SomeDataPack = SomeDataPack{ pack :: [SomeData] } deriving (Show, Generic)
Isn't this going to be a record? {"pack": [an array goes here]} just as with the preceding definition, but with only a single field. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

yes, I see, thanks ;-)
this did the trick:
....
case (eitherDecode' x :: Either String [SomeData]) of
....
On Sat, Jan 4, 2014 at 12:48 AM, Brandon Allbery
On Fri, Jan 3, 2014 at 6:42 PM, Miro Karpis
wrote: data SomeDataPack = SomeDataPack{ pack :: [SomeData] } deriving (Show, Generic)
Isn't this going to be a record? {"pack": [an array goes here]} just as with the preceding definition, but with only a single field.
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (2)
-
Brandon Allbery
-
Miro Karpis