[Haskell-beginners] Aeson: parsing json with 'data' field

Miro Karpis miroslav.karpis at gmail.com
Sat Oct 4 07:07:28 UTC 2014


Hi,
please can you help me with this.......I have a json file which contains a
field with name "data". Problem is that I can not create a data type with
"data", (or can I)? How else can I handle this? I know I can convert all
json to Object and then search for the field....but I was hoping for some
friendly/easier option.


json example:

{
  "data" : {
    "foo" : "bar"
  }
}


below definition returns: parse error on input ‘data’
data Foo = Foo {
  data :: String
}


Cheers,
Miro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20141004/ce159376/attachment.html>


More information about the Beginners mailing list