[Haskell-cafe] A question about data declaration

Doug Burke dburke.gw at gmail.com
Sat Mar 23 17:47:51 CET 2013


On Mar 22, 2013 2:58 AM, "C K Kashyap" <ckkashyap at gmail.com> wrote:
>
> Thanks Eric and Brent,
>
> Even with GADT, it appears that I'd need extra data definitions. I'll go
without GADT then ...
>
> Brent, my use case is not particularly complicated. I am trying to model
the pdf spec - which says that pdf contains Objects that could of of types
Number, String, Name, Array and Dictionary - while array is list of
objects, the Disctionary is a list of tuples (Name, Object) not (Object,
Object) - hence my situation.
>
> Regards,
> Kashyap
>

You could have a look at how the aeson package represents JavaScript
values, which have a similar structure to your requirement, e.g.
http://hackage.haskell.org/packages/archive/aeson/0.6.1.0/doc/html/Data-Aeson-Types.html#t:Value

Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130323/320dee51/attachment.htm>


More information about the Haskell-Cafe mailing list