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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 8C11E7ED7A for ; Wed, 19 Sep 2012 09:25:22 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jacques.garrigue@gmail.com) identity=pra; client-ip=209.85.214.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="jacques.garrigue@gmail.com"; x-sender="jacques.garrigue@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of jacques.garrigue@gmail.com designates 209.85.214.182 as permitted sender) identity=mailfrom; client-ip=209.85.214.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="jacques.garrigue@gmail.com"; x-sender="jacques.garrigue@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.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=mail1-smtp-roc.national.inria.fr; envelope-from="jacques.garrigue@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: AkICAHNyWVDRVda2k2dsb2JhbABFqmmRXwgjAQEBAQkJCwkUBCOCIAEBAQQSAiwBOAEDDAEFBQsDCi4hARIBBQEcBhMIGodPAwycBgkDjxiFOScNTIkBAQUMii5ihkEDiFSLOoFVixeDKxYpgVaCPw X-IronPort-AV: E=Sophos;i="4.80,447,1344204000"; d="scan'208";a="173757970" Received: from mail-ob0-f182.google.com ([209.85.214.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 19 Sep 2012 09:25:21 +0200 Received: by mail-ob0-f182.google.com with SMTP id un3so1333031obb.27 for ; Wed, 19 Sep 2012 00:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Ad8k35e6uxwULV2Nig2iz7HJ8DRfEh7mxATa/Oadw30=; b=aDqrU2IkAe5IDLqJjdFRxfqbHvtKkZNZhXHXeTBwGvmhgVzGEjsdx9/e9GApdtK/9t m6bOZ0KkvbEfJkaQjC6jT+5gvNg6ruobpJUjbBGZuERpID7ETG+ka23FJYtMdNr+BG0S ljbHMYvsE/dX+XQXcCAWJYtD7ih2+BybhlCpx2ZoKenUTMrFuZSZJNhNpdlovh6tw7MJ d6Cow1bhV/C6VRn/yt13ScuLTx69pBCXAQF+oX88aKUJKito9MWkOY7cUDT3x61SHc18 C9k9C+frrhtbMChQyp5wqhus9SPuzygYpNBbll+t54zjvmWVCJJYIq0LJdJAnOmVo64V Pa1w== MIME-Version: 1.0 Received: by 10.60.27.229 with SMTP id w5mr132891oeg.125.1348039521819; Wed, 19 Sep 2012 00:25:21 -0700 (PDT) Sender: jacques.garrigue@gmail.com Received: by 10.182.14.132 with HTTP; Wed, 19 Sep 2012 00:25:21 -0700 (PDT) In-Reply-To: References: Date: Wed, 19 Sep 2012 16:25:21 +0900 X-Google-Sender-Auth: WBNiV3rLymp0esywcehORnRsr5g Message-ID: From: Jacques Garrigue To: Malcolm Matalka Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Expressing module sig and impl in mli file On Wed, Sep 19, 2012 at 7:40 AM, Malcolm Matalka wrote: > I spoke too soon! Below is my testcase and error. Where did I go wrong? > > foo.mli: > open Core.Std > > module Bar : sig > include Identifier with type t = String.t > end > > foo.ml: > open Core.Std > > module Bar : Identifier = String > > The error: > Type declarations do not match: > type t = Bar.t > is not included in > type t = Core.Std.String.t First comment: there is no need to use include here. You can just write module Bar : Identifier with type t = String.t in the interface. Since there is an interface, there is not need to restrict Bar in the implementation, so just write: module Bar = String If you want to add a signature in the implementation, it should be a subtype of the interface signature. Jacques Garrigue