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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id A899C7F9BB for ; Wed, 2 Jul 2014 11:30:42 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel@kerneis.info) identity=pra; client-ip=176.31.113.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel@kerneis.info"; x-sender="gabriel@kerneis.info"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel@kerneis.info designates 176.31.113.173 as permitted sender) identity=mailfrom; client-ip=176.31.113.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel@kerneis.info"; x-sender="gabriel@kerneis.info"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@wanbli.kerneis.info designates 176.31.113.173 as permitted sender) identity=helo; client-ip=176.31.113.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel@kerneis.info"; x-sender="postmaster@wanbli.kerneis.info"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoUBAHfQs1OwH3Gtl2dsb2JhbABaylYBgQwWDwEBAQEBCBYHPIQDAQEFJwsBDQEBNwEPCxgJJQ8FSYhZAakjhXkBBZYhEQaPHweDLYEWkEqKIIZ6EJA9 X-IPAS-Result: AoUBAHfQs1OwH3Gtl2dsb2JhbABaylYBgQwWDwEBAQEBCBYHPIQDAQEFJwsBDQEBNwEPCxgJJQ8FSYhZAakjhXkBBZYhEQaPHweDLYEWkEqKIIZ6EJA9 X-IronPort-AV: E=Sophos;i="5.01,587,1400018400"; d="scan'208";a="83269463" Received: from wanbli.kerneis.info ([176.31.113.173]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 02 Jul 2014 11:30:42 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kerneis.info; s=wanbli-rsa1; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=vhDmYa0gDHUNrzlldx7ujfUzWTlQRrjTaoI3VoBBOEo=; b=nW4O+Ce2dtwif12u5GDHslUud2rg7SQk3uvQ20TW4ZFW/CuF1nzIOtzxfuQgibyTj+lnaokNvoQSg5KIrQuXqMgS40jv0pbwzag9tfc4T/Jy+7hO+8TOs3qMSmgpeRhBD011THoWkEbzTJ1wJLXZkBsUsieeswfVig5wir3rQOY=; Received: from [90.218.3.187] (helo=localhost) by wanbli.kerneis.info with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1X2GsB-0006GA-0d; Wed, 02 Jul 2014 09:30:39 +0000 Date: Wed, 2 Jul 2014 10:30:38 +0100 From: Gabriel Kerneis To: Daniel =?iso-8859-1?Q?B=FCnzli?= Cc: Nicolas Ratier , caml-list@inria.fr Message-ID: <20140702093037.GC4470@kerneis.info> References: <53B3C402.8070001@femto-st.fr> <61DE677B8B2B47D8802464F092A13EC2@erratique.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <61DE677B8B2B47D8802464F092A13EC2@erratique.ch> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 90.218.3.187 X-SA-Exim-Mail-From: gabriel@kerneis.info X-SA-Exim-Scanned: No (on wanbli.kerneis.info); SAEximRunCond expanded to false Subject: Re: [Caml-list] Case insensitive in type On Wed, Jul 02, 2014 at 09:43:13AM +0100, Daniel Bünzli wrote: > Le mercredi, 2 juillet 2014 à 09:34, Nicolas Ratier a écrit : > > I would like the string of the Term constructor not to be case sensitive, > > for example, all the following terms should be the same : > > [...] > > Is it possible ? > > The only way to do this is to make the type private and always > construct term values through a constructor which normalizes the > strings. > > type term = private Term of string * term list > let term s args = Term ((String.lowercase s), args) It will not help with pattern-matching, though. The following will fail: match (term "plus" []) with | Term("Plus",[]) -> true | _ -> assert false I don't think there is a way to work around this. -- Gabriel