From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 3207CBC37 for ; Thu, 10 Dec 2009 19:10:38 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap0CAPvIIEtQDPJjfGdsb2JhbACEG5csAQELCQoHEwWrNpAQg1lSBIMYgzw X-IronPort-AV: E=Sophos;i="4.47,376,1257116400"; d="asc'?scan'208,217";a="38376657" Received: from smtp28.orange.fr ([80.12.242.99]) by mail2-smtp-roc.national.inria.fr with ESMTP; 10 Dec 2009 19:10:36 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2804.orange.fr (SMTP Server) with ESMTP id A8CB4700010F; Thu, 10 Dec 2009 19:10:35 +0100 (CET) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2804.orange.fr (SMTP Server) with ESMTP id 949A77000111; Thu, 10 Dec 2009 19:10:35 +0100 (CET) Received: from [192.168.1.2] (LAubervilliers-153-53-1-14.w217-128.abo.wanadoo.fr [217.128.128.14]) by mwinf2804.orange.fr (SMTP Server) with ESMTP id 1B109700010F; Thu, 10 Dec 2009 19:10:35 +0100 (CET) X-ME-UUID: 20091210181035110.1B109700010F@mwinf2804.orange.fr X-ME-User-Auth: serge.leblanc Subject: Re: [Caml-list] revised syntax for abstract types ? From: Serge Leblanc To: Nicolas Pouillard Cc: caml-list In-Reply-To: <1260452934-sup-6342@peray> References: <1260446204.22959.298.camel@serge2.localnet> <1260452934-sup-6342@peray> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-iUX5BDsoWAwo74AoOP4z" Date: Thu, 10 Dec 2009 19:10:28 +0100 Message-Id: <1260468628.22959.510.camel@serge2.localnet> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 X-Spam: no; 0.00; syntax:01 0100,:01 syntax:01 ocaml:01 arcs:01 arcs:01 gpg:01 3324:01 0100,:01 ocaml:01 gpg:01 3324:01 2009:98 2009:98 trie:98 X-Attachments: cset="utf-8" type="application/pgp-signature" name="signature.asc" --=-iUX5BDsoWAwo74AoOP4z Content-Type: multipart/alternative; boundary="=-VjRa4Jst/FFvDYT+yYtn" --=-VjRa4Jst/FFvDYT+yYtn Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, 2009-12-10 at 14:49 +0100, Nicolas Pouillard wrote: > Excerpts from Serge Leblanc's message of Thu Dec 10 12:56:44 +0100 2009: > > Hi, the documentation for the revised syntax explain that abstract type= s > > are expressed by : >=20 > The documentation is too old, abstract types now have the same syntax in > revised than in the original OCaml syntax. >=20 In the following types definitions, type trie 'a =3D [ Trie of arcs 'a ] and arcs 'a =3D list ('a * trie 'a); type zipper 'a =3D [ Top | Zip of (arcs 'a * 'a * arcs 'a * zipper 'a) ] and edit_state 'a =3D (zipper 'a * trie 'a); why is it not possible to describe them thus ? type letter =3D 'a; type trie =3D [ Trie of arcs ] and arcs =3D list (letter * trie); type zipper =3D [ Top | Zip of (arcs * letter * arcs * zipper) ] and edit_state =3D (zipper * trie); Thanks for your help. -- Serge Leblanc gpg --keyserver hkp://keyserver.ubuntu.com:11371 --recv-keys 0x33243C1B Fingerprint =3D 066C 005F 5595 D85C 7673 D969 1DD4 90C4 3324 3C1B --=-VjRa4Jst/FFvDYT+yYtn Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, 2009-12-10 at 14:49 +0100, Nicolas Pouillard wrote:
Excerpts from Serge Leblanc's message of Thu Dec 10 12:56:44 +0100 2009:
> Hi, the documentation for the revised syntax explain that abstract typ=
es
> are expressed by :

The documentation is too old, abstract types now have the same syntax in
revised than in the original OCaml syntax.


In the following types definitions,

type trie 'a =3D [ Trie of arc= s 'a ]
and arcs 'a =3D list ('a * tri= e 'a);

type zipper 'a =3D [ Top | Zip of (arcs 'a * 'a * ar= cs 'a * zipper 'a) ]
and edit_state 'a =3D (zipper = 'a * trie 'a);

why is it not possible to describe them thus ?

type letter =3D 'a;
type trie =3D [ Trie of arcs ]=
and arcs =3D list (letter * tr= ie);

type zipper =3D [ Top | Zip of (arcs * letter * arcs * zipper) ]

and edit_state =3D (zipper * t= rie);

Thanks for your help.
--
Serge Leblanc
gpg --keyserver  hkp://keyserver.ubuntu.com:11= 371 --recv-keys 0x33243C1B
Fingerprint =3D 066C 005F 5595 D85C 7673  D969= 1DD4 90C4 3324 3C1B
--=-VjRa4Jst/FFvDYT+yYtn-- --=-iUX5BDsoWAwo74AoOP4z Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkshOYMACgkQHdSQxDMkPBtzVQCeJ65DiQB/66qKio2JA9onFXfX rfMAn3j0ggJQZXxb+SR6+bTV+GYKRVLb =jc4B -----END PGP SIGNATURE----- --=-iUX5BDsoWAwo74AoOP4z--