caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Trevor Smith <trevorsummerssmith@gmail.com>
To: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: [Caml-list] GADTs and JSON
Date: Thu, 21 May 2015 12:42:27 -0400	[thread overview]
Message-ID: <CAG-KTt_Um5B263zK3M6Y7on62-F0rrkb-1MpcRtMqTH6tLRDjQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 507 bytes --]

Hello,

Is it possible to encode a recursive, heterogenous map and list
datastructure with GADTs?

I want to encode JSON (there are already a couple of great libraries out
there so this is kind of an academic question). I would like to have
functions that can only take a JSON map type, for example to take a json
map and return a value. The key here is that the map can hold values of
type int,string and also maps. Is this possible?

eg get : (map : map json) -> key:string -> 'a json

Thank you.

Trevor

[-- Attachment #2: Type: text/html, Size: 659 bytes --]

             reply	other threads:[~2015-05-21 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 16:42 Trevor Smith [this message]
2015-05-21 16:59 ` Milan Stanojević
2015-05-21 18:44 ` Rodolphe Lepigre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAG-KTt_Um5B263zK3M6Y7on62-F0rrkb-1MpcRtMqTH6tLRDjQ@mail.gmail.com \
    --to=trevorsummerssmith@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).