Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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
 Outer.t
?


Thanks,
 David

-- 
David Teller-Rajchenbach
 Security of Distributed Systems
  http://www.univ-orleans.fr/lifo/Members/David.Teller
 Angry researcher: French Universities need reforms, but the LRU act
brings liquidations.