caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "José Romildo Malaquias" <j.romildo@gmail.com>
To: Matthieu Dubuget <matthieu.dubuget@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Importing specific names
Date: Fri, 26 Oct 2012 15:51:03 -0200	[thread overview]
Message-ID: <20121026175103.GB20358@romildo.no-ip.org> (raw)
In-Reply-To: <508A965F.3000205@gmail.com>

On Fri, Oct 26, 2012 at 03:55:43PM +0200, Matthieu Dubuget wrote:
> Le 26/10/2012 13:26, José Romildo Malaquias a écrit :
> >  Hello.
> >
> >  It seems that the expression ocaml "open module-path" exposes all names
> >  exported by module-path.
> >
> >  Is there any way of exposing only a restrict set of names from a
> >  module-path, instead of all names?
> 
> Is this what you are looking for?
> 
> # module type RS = sig
>     val length : string -> int
>    end;;
> module type RS = sig val length : string -> int end
> # module ReducedString:RS = String;;
> module ReducedString : RS
> # ReducedString.length "coco";;
> - : int = 4
> # ReducedString.uppercase "coco";;
> Error: Unbound value ReducedString.uppercase

This has the disadvantage to explicitly include the type signature of
values, and probably the type definition of types. There sould be easier
ways, where only the relevant names would have to be mentioned.

Romildo

  reply	other threads:[~2012-10-26 17:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-26 11:26 José Romildo Malaquias
2012-10-26 11:26 ` David House
2012-10-26 11:30   ` David House
2012-10-26 17:45   ` José Romildo Malaquias
2012-10-26 13:55 ` Matthieu Dubuget
2012-10-26 17:51   ` José Romildo Malaquias [this message]
2012-10-26 14:48 ` Edgar Friendly
2012-10-26 15:20   ` Yaron Minsky
2012-10-26 17:56   ` José Romildo Malaquias
2012-10-26 15:26 ` Didier Cassirame

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121026175103.GB20358@romildo.no-ip.org \
    --to=j.romildo@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=matthieu.dubuget@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).