semi-private exports

Hal Daume III hdaume@ISI.EDU
Mon, 22 Apr 2002 20:19:26 -0700 (PDT)


Hi again, all.

In my NLP.Prelude file, I define:

> newtype Token = Token [Word8]

and I export only the type, not the constructor because I don't users of
my package to be able to inspect/modify the list directly.  However, in my
NLP.IO module, in which I define IO for some of my data types, I need to
be able to access it directly.

In Java/C#, I would make Token public and the constructor protected (i.e.,
public for the current package but private for other people).  I would
really like to be able to do something similar.  Any ideas?

 - Hal

--
Hal Daume III

 "Computer science is no more about computers    | hdaume@isi.edu
  than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume