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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id A63907ED7A for ; Wed, 19 Sep 2012 09:36:43 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of mmatalka@gmail.com) identity=pra; client-ip=209.85.214.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="mmatalka@gmail.com"; x-sender="mmatalka@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of mmatalka@gmail.com designates 209.85.214.182 as permitted sender) identity=mailfrom; client-ip=209.85.214.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="mmatalka@gmail.com"; x-sender="mmatalka@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ob0-f182.google.com) identity=helo; client-ip=209.85.214.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="mmatalka@gmail.com"; x-sender="postmaster@mail-ob0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmICAJx0WVDRVda2k2dsb2JhbABFqmKRZggjAQEBAQkJCwkUBCOCIAEBAQQSAiwBGxILAQMMBgULAwoNISEBAREBBQEKEgYTEhCHTgEDDAubdwkDjCWCc4UWChknAwpZiHQBBQyKLmKGQQOUDoFVgRSKA4MrFimECA X-IronPort-AV: E=Sophos;i="4.80,447,1344204000"; d="scan'208";a="156213011" Received: from mail-ob0-f182.google.com ([209.85.214.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 19 Sep 2012 09:36:42 +0200 Received: by obbun3 with SMTP id un3so1346233obb.27 for ; Wed, 19 Sep 2012 00:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=P4q6ZRK/qRwDPdhTdRfvlUI2rRFZFsQENXRSOZhSdM4=; b=cpr5xBJPCisS/Ge0dJ02sCk3/6HlYs+aFW/KCcK5FkGhZJYcuWTc01txcU6gyd2NNc 8yKRdRsusOSxj8oL1j/s3qna05+zRKu551gR9u5MNqK76gnw4xYsHVZRgx17VRqi7Z3I Y/RcwCV5A4XYsxUL2jkzwQcEs6bRaRyYDFehbJTjhypsjaYlYS670zKv8nIJYju5Irqo o9GbbxYXbxyPbP/K+eVN0/jbrd6w69Br18YkaWmRifIPbH9JSFfM1MhEUbTFAwQxUlIg Zi2DVC3qaaBkHBbXHssfbkdxOnrHpCS8Yje4jDp2mLaIFD/tknnGdCpnYzo9ILNxwyPM 22Wg== MIME-Version: 1.0 Received: by 10.60.154.198 with SMTP id vq6mr2506622oeb.20.1348040201511; Wed, 19 Sep 2012 00:36:41 -0700 (PDT) Received: by 10.76.23.9 with HTTP; Wed, 19 Sep 2012 00:36:41 -0700 (PDT) In-Reply-To: References: <505929CD.70206@gmail.com> Date: Wed, 19 Sep 2012 09:36:41 +0200 Message-ID: From: Malcolm Matalka To: David House Cc: Edgar Friendly , caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Expressing module sig and impl in mli file Yes I think I'm confused. In all parts of this module I want the Identifiable behaviour, but at the same time I want a Map of these identifiers to something, so this turned in to me trying to jerry-rig that rather than thinking about what I actually want. Can something that is Identifiable be the key to a Map (in Core)? Am I doing something wrong if I want that? Thanks /M On Wed, Sep 19, 2012 at 9:11 AM, David House wrote: > The standard way of doing this is as follows (note that Identifier is > changing to Identifiable in the next version, so I'll use that > terminology): > > module Bar : sig > type t = string > include Identifiable with type t := t > end > > But if this is literally what you're doing, I'm sort of confused. The > point of identifiable is that you have explicit to_string/from_string > functions and the type equality with string is not exposed. E.g. you > might want to use a different comparison function than string > equality. If you expose the type equality with string, then people are > free to use String.compare on your type, so you don't get the > abstraction you wanted. > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >