From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p0QCx5V0030764 for ; Wed, 26 Jan 2011 13:59:05 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkYBAKGpP03RVdi2kGdsb2JhbACkbggVAQEBAQkJDAcRBCChfIoAgheFDC6IWQEBAwWFSgSMKQ X-IronPort-AV: E=Sophos;i="4.60,379,1291590000"; d="scan'208";a="96791528" Received: from mail-qy0-f182.google.com ([209.85.216.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-MD5; 26 Jan 2011 13:58:59 +0100 Received: by qyk36 with SMTP id 36so904183qyk.6 for ; Wed, 26 Jan 2011 04:58:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=Phh2VQMuwi9w04EDu8c+vX++GgF/YhD9Iw+gxGaEf4I=; b=KqHmiV6QCueC67YsYX4tpNSLNtZdbTflXh49jLsQF1af8FVxVkF5yTW/mJmdJEOBxM 7kG07jJqM8R6YWNuWdthhjSfGEo8SjPVJiQ7zizjqD0c8uhK9MJJYNwFR10YOcIFogaZ 1YCJgJ7hovXibZUb10C6tn8tI1N4oFGl6z7wM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=sFoVZSeds5r9EKNaqmaKvPn2veaweqrxkDDIPuJJXKllMh7KRN3cj2SsxjVIQ+QrTM bH7W6BZGXNfwHOA8y6+oSigDs6TbWmSqJWvFkku+i4q54Ohvy3OdTU+ikESDWGxamHza GdXv6fYAF/Eq5ZOQI5gZ9GrwlnSyzZr3P77n8= MIME-Version: 1.0 Received: by 10.229.85.208 with SMTP id p16mr390280qcl.71.1296046738520; Wed, 26 Jan 2011 04:58:58 -0800 (PST) Received: by 10.229.186.76 with HTTP; Wed, 26 Jan 2011 04:58:58 -0800 (PST) Date: Wed, 26 Jan 2011 13:58:58 +0100 Message-ID: From: Julien Signoles To: Caml List Content-Type: multipart/alternative; boundary=0016368322d4763c1a049abf65b5 Subject: [Caml-list] Converting "fun ... (type t) ..." into a caml < 3.12 code --0016368322d4763c1a049abf65b5 Content-Type: text/plain; charset=ISO-8859-1 Hello, How to convert the following ocaml 3.12 code into a typable ocaml < 3.12 code? I have a solution using Obj. Is it possible without Obj? ===== (* val f: 'a -> 'a list *) let f (type u) (x:u) = let module S = Set.Make(struct type t = u let compare = Pervasives.compare let equal = ( = ) end) in S.elements (S.singleton x) ===== The contraints are: * do not change the type of f * use the functor Set.Make where type of keys are the same that type of x Thanks, Julien --0016368322d4763c1a049abf65b5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello,

How to convert the following ocaml 3.12 code into a typable o= caml < 3.12 code?
I have a solution using Obj. Is it possible without= Obj?

=3D=3D=3D=3D=3D
(* val f: 'a -> 'a list *)
le= t f (type u) (x:u) =3D
=A0 let module S =3D
=A0=A0=A0 Set.Make(struct
=A0=A0=A0 =A0 type t = =3D u
=A0=A0=A0 =A0 let compare =3D Pervasives.compare
=A0=A0=A0 =A0 = let equal =3D ( =3D )
=A0=A0=A0 end)
=A0 in
=A0 S.elements (S.sing= leton x)
=3D=3D=3D=3D=3D

The contraints are:
* do not change t= he type of f
* use the functor Set.Make where type of keys are the same that type of x
Thanks,
Julien
--0016368322d4763c1a049abf65b5--