English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Hiding a public module/type?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-11-03 (21:35)
From: David Teller <David.Teller@u...>
Subject: Hiding a public module/type?
     Dear list,

 In order to simplify the error messages for users of my library, I'd
like to hide some type aliasing.

I have the following:

(*** module [Inner], defined in inner.mli ***)
type t

(*** module [Outer], defined in outer.mli ***)
type t = Inner.t
val f : t -> t

Now, module [Inner] is only useful to define the library and shouldn't
be visible from the outside. Unfortunately, for the moment, whenever a
client makes a type error involving [f], the error message looks like

# f 5;;
This expression has type int but is used with type
 Outer.t = Inner.t

Is there a simple way of turning this error message into

This expression has type int but is used with type


David Teller-Rajchenbach
 Security of Distributed Systems
 Angry researcher: French Universities need reforms, but the LRU act
brings liquidations.