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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id D219C7F8BE for ; Sun, 27 Apr 2014 16:22:58 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of lpw25@cam.ac.uk) identity=pra; client-ip=131.111.8.151; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="lpw25@cam.ac.uk"; x-sender="lpw25@cam.ac.uk"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of lpw25@cam.ac.uk) identity=mailfrom; client-ip=131.111.8.151; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="lpw25@cam.ac.uk"; x-sender="lpw25@cam.ac.uk"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@ppsw-51.csi.cam.ac.uk) identity=helo; client-ip=131.111.8.151; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="lpw25@cam.ac.uk"; x-sender="postmaster@ppsw-51.csi.cam.ac.uk"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkICAOMRXVODbwiXf2dsb2JhbABZrwsBAQWZdoEIFg4BAQkNEhQogiUBAQQBJxM/BQsLGAkaCw8BBA08E4gtAwkIBMIKDVeGIReFWoZnghgHhDkElRqCAoFwjQmHR4FA X-IPAS-Result: AkICAOMRXVODbwiXf2dsb2JhbABZrwsBAQWZdoEIFg4BAQkNEhQogiUBAQQBJxM/BQsLGAkaCw8BBA08E4gtAwkIBMIKDVeGIReFWoZnghgHhDkElRqCAoFwjQmHR4FA X-IronPort-AV: E=Sophos;i="4.97,937,1389740400"; d="scan'208";a="59209887" Received: from ppsw-51.csi.cam.ac.uk ([131.111.8.151]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Apr 2014 16:22:58 +0200 X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from host5-81-227-48.range5-81.btcentralplus.com ([5.81.227.48]:42551 helo=study.localdomain) by ppsw-51.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:587) with esmtpsa (PLAIN:lpw25) (TLSv1.2:DHE-RSA-AES128-SHA:128) id 1WePyr-0008Vw-XH (Exim 4.82_3-c0e5623) (return-path ); Sun, 27 Apr 2014 15:22:57 +0100 From: Leo White To: Berke Durak Cc: caml-list@inria.fr References: <20140427125207.GA28200@gmail.com> <20140427134510.GB28200@gmail.com> X-Face: "XWxb[u_Z\PA_Y?9@|IA!!+jTb(/290-*ea/Un$I0B98.$n%eL.;2w*,z]WR#T:,p[ NBd++M7l]#7zj7!{~iw $W-"/=|dVjhT[D{4~gE}gK<2`.6fs!;uqqud]vs2N/3^m7{aS1V, Date: Sun, 27 Apr 2014 15:34:48 +0100 In-Reply-To: <20140427134510.GB28200@gmail.com> (Berke Durak's message of "Sun, 27 Apr 2014 09:45:11 -0400") Message-ID: <87r44i96yf.fsf@study.localdomain> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Caml-list] Ocaml 4.02.0+dev4-2014-04-03 toplevel: module aliases no longer print module signature The semantics of module aliases has changed in 4.02, so now: module S = String creates a proper alias to String. This means, for example, that the type `Map.Make(String).t` is now equivalent to `Map.Make(S).t`: OCaml version 4.02.0+dev4-2014-04-03 # module S = String;; module S = String # let f (x : 'a Map.Make(String).t) : 'a Map.Make(S).t = x;; val f : 'a Map.Make(String).t -> 'a Map.Make(S).t = where as previously: OCaml version 4.01.0 # module S = String;; module S : sig [...] end # let f (x : 'a Map.Make(String).t) : 'a Map.Make(S).t = x;; Characters 55-56: let f (x : 'a Map.Make(String).t) : 'a Map.Make(S).t = x;; ^ Error: This expression has type 'a Map.Make(String).t but an expression was expected of type 'a Map.Make(S).t In order to expose such aliases in signatures, you can now write `module S = String` in signatures as well as structures. This is why the output from the top-level has changed: it is still printing the type of `S`, but `S` now has type `= String`. To help people who previously defined aliases to print a module's contents, the `#show` directive has been added to the top-level: # #show module String;; module String : sig [...] end Regards, Leo Berke Durak writes: > On Sun, Apr 27, 2014 at 09:18:26AM -0400, Yaron Minsky wrote: >> Sends preferable behavior to me, since it avoid overly long signatures and >> more clearly reflects the new semantics of module aliases. > > If that's the issue, when the toplevel is connected to a tty, it should cut the > output at some point and put an ellipsis. If it's not a tty, it should still > blast the full signature. > > I'm surely not the only one who has been relying on module X = Blah to see the > signature of a module. Old habits die hard. > > Also module SM = Map.Make(String) still prints the full declaration. > >> But it might be nice to have a way to see the contents of a module in the >> toplevel. Maybe steak the #typeof declaration from utop? > > How does one print a module signature in utop? > > -- > Berke Durak