public/private module sections

Marcin 'Qrczak' Kowalczyk qrczak at
Mon Feb 27 19:07:22 EST 2006

"Claus Reinke" <claus.reinke at> writes:

> you mean as in "public static void main(String[] args) { ..}"
> instead of "main args = .."?-) there are such languages, and
> I'm happy to say Haskell isn't one of them!

In my language Kogut the default everywhere (modules, objects) is
public. I don't care what information hiding extremists would say.
It's not painful if the default is public :-)

There are definitions to override this:
   private {definitions}
   public {definitions}
   private => definitions
   public => definitions
   private pattern
   public pattern
   private name
   public name
or alternatively Haskell-style module headers.

There is also 'use' (Haskell's 'import') and 'reexport' (Haskell's
'import' but imported names are made public).

I found myself using primarily 'private' on individual names,
or module headers if the module export list is very short,
or rarely 'private' over a region of definitions.

   __("<         Marcin Kowalczyk
   \__/       qrczak at

More information about the Haskell-prime mailing list