From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id BECFBBC6B for ; Sun, 10 Feb 2008 20:56:26 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHnlrkfAXQImh2dsb2JhbACQOwEBAQgKKZUg X-IronPort-AV: E=Sophos;i="4.25,330,1199660400"; d="scan'208";a="9006330" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 10 Feb 2008 20:56:26 +0100 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m1AJuP34017142 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sun, 10 Feb 2008 20:56:26 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABbmrkfUTWUFmWdsb2JhbACQOwEBAQEBBgIGCwgYlSM X-IronPort-AV: E=Sophos;i="4.25,330,1199660400"; d="scan'208";a="7142612" Received: from mx1.wp.pl ([212.77.101.5]) by mail2-smtp-roc.national.inria.fr with ESMTP; 10 Feb 2008 20:56:25 +0100 Received: (wp-smtpd smtp.wp.pl 13075 invoked from network); 10 Feb 2008 20:56:24 +0100 Received: from phpdk6.ph.kcl.ac.uk (HELO [137.73.5.196]) (d0@[137.73.5.196]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 10 Feb 2008 20:56:24 +0100 Message-ID: <47AF56E5.1090302@wp.pl> Date: Sun, 10 Feb 2008 19:56:21 +0000 From: Dawid Toton User-Agent: Thunderbird 1.5.0.12 (X11/20071219) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Fine-grained types with more general library References: <47AF4B6E.3070306@uj.edu.pl> <47AF4D50.9070104@gmail.com> In-Reply-To: <47AF4D50.9070104@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [ETP0] X-Miltered: at discorde with ID 47AF56E9.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; fine-grained:01 val:01 val:01 toplevel:01 syntax:01 caml-list:01 caml-list:01 caml:02 string:02 string:02 seems:03 library:03 types:05 types:05 inria:06 > type 'a path = string list > type remote_t = `Remote path > type local_t = `Local path > > val works_on_remote_t : [> `Remote] path -> whatever > val works_on_local_t : [> `Local] path -> whatever > val works_on_any_t : 'a path -> whatever > > See the following URL for more details on this trick (called Phantom Types): > http://caml.inria.fr/pub/ml-archives/caml-list/2001/09/081c77179ee2a3787233902a51633122.en.html > > Thank you all for immediate responses! After playing with toplevel I managed to get the correct syntax: type 'a path = string list type remote_t = [`Remote] path type local_t = [`Local] path This seems as yet to be very good solution.:) Dawid