Haskell-prime Digest, Vol 2, Issue 58

Axel Simon A.Simon at kent.ac.uk
Fri Feb 24 06:05:19 EST 2006

On Fri, 2006-02-24 at 11:20 +0100, John Hughes wrote:
>     From: "Claus Reinke" <claus.reinke at talk21.com>
>     let's go through 5.2 "Export Lists" to see what would be missing
>     if we tried to replace the export list with a separation of a module
>     into a public (exported) and a private (local) part:
>     ...
>     any other issues I missed here?
> I feel unkeen.
> One of the nice things about Haskell is that definitions can appear in any order. That makes it possible to gather a group of logically related definitions together, within a module. With your proposal, exported definitions and non-exported ones would have to be separated.

I agree, I'd find it inconvenient, too. But what about a Jave/C++ like
approach where you sprinkle public and private declarations throughout?


main = ....


helper1 = ...
helper2 = ...



In particular you can have

public: A(C,D)

data A = A | B | C | D

which only exports the C and D constructors.

Furthermore, I'd like to propose to have a colon after public, private,
default, infixl, infixr, infix, which frees all these identifiers for
normal use as identifiers. There was a mail earlier on "Collection
Framework" with a complaint that 'default' is a keyword.


More information about the Haskell-prime mailing list