From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 437487EE7D for ; Thu, 21 May 2015 18:42:30 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of trevorsummerssmith@gmail.com) identity=pra; client-ip=209.85.192.42; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="trevorsummerssmith@gmail.com"; x-sender="trevorsummerssmith@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of trevorsummerssmith@gmail.com designates 209.85.192.42 as permitted sender) identity=mailfrom; client-ip=209.85.192.42; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="trevorsummerssmith@gmail.com"; x-sender="trevorsummerssmith@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qg0-f42.google.com) identity=helo; client-ip=209.85.192.42; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="trevorsummerssmith@gmail.com"; x-sender="postmaster@mail-qg0-f42.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0ACAQCcCV5VmyrAVdFchEIGgxm/cgmJEQc4FAEBAQEBAQERAQEBAQEGCwsJIS6EGSIRBBkBGx4DEggBBzcCJAERAQUBIjWHdAEDEp5CgzA+MYs+gWuCeZlmChknDVeEQQEFDog8imSBRQWQPo1DlVMSI4EMCYEEgzMiMYJHAQEB X-IPAS-Result: A0ACAQCcCV5VmyrAVdFchEIGgxm/cgmJEQc4FAEBAQEBAQERAQEBAQEGCwsJIS6EGSIRBBkBGx4DEggBBzcCJAERAQUBIjWHdAEDEp5CgzA+MYs+gWuCeZlmChknDVeEQQEFDog8imSBRQWQPo1DlVMSI4EMCYEEgzMiMYJHAQEB X-IronPort-AV: E=Sophos;i="5.13,470,1427752800"; d="scan'208";a="125649706" Received: from mail-qg0-f42.google.com ([209.85.192.42]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 May 2015 18:42:29 +0200 Received: by qget53 with SMTP id t53so43645031qge.3 for ; Thu, 21 May 2015 09:42:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=h4gh8wNZtZ351Tdgx+LF1mrq/944y9JWWHTKxn59vYo=; b=Qvy8O/FWAjHxT+dXTbu2aiTeyJAxVTNTpXAQt2e0NG1cZLsQ+t9Q0mixvRGXoGvStO v1pHlKoH9El1FFxsrwQHvxob//0mDwWMsrr1yLzHs18AhI1Ph+c+bLPNh9181bzijWz9 FoSrTDjwjXjDOWTVyGMI2I68MANsO/1fzKzLJkZm1YOshske6Jj0klXA8nBIL3FvTqDv ++ceRsYCkCdil6jhJLiagSx/SH0e+Du85FsNr+DV/4K99uiqY+GFqmYPWiF/lUpDqphv UFrwe238c+UQuLKZOmyv5kJAeM0/XCvMpp5x8h7VHBWanCIkjmwAGX9XvOtHNrw930DC 9bWw== MIME-Version: 1.0 X-Received: by 10.140.150.78 with SMTP id 75mr5356932qhw.10.1432226548024; Thu, 21 May 2015 09:42:28 -0700 (PDT) Received: by 10.229.250.2 with HTTP; Thu, 21 May 2015 09:42:27 -0700 (PDT) Date: Thu, 21 May 2015 12:42:27 -0400 Message-ID: From: Trevor Smith To: "caml-list@inria.fr" Content-Type: multipart/alternative; boundary=001a11355856a20b5305169a3ae6 Subject: [Caml-list] GADTs and JSON --001a11355856a20b5305169a3ae6 Content-Type: text/plain; charset=UTF-8 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 --001a11355856a20b5305169a3ae6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello,

Is it possible to encode a recur= sive, heterogenous map and list datastructure with GADTs?

I want to encode JSON (there are already a couple of great librarie= s 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 ma= p 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
--001a11355856a20b5305169a3ae6--