Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Aeson: parsing json with 'data' field (Miro Karpis)


----------------------------------------------------------------------

Message: 1
Date: Sat, 4 Oct 2014 09:07:28 +0200
From: Miro Karpis <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] Aeson: parsing json with 'data' field
Message-ID:
        <CAJnnbxH6hVgTHA_O1d=q2mg2s_y4ehpdny9eb49gexuw+io...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

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-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 76, Issue 4
****************************************

Reply via email to