Prelude/main magicks?

Niklas Broberg n_broberg at
Sun May 9 19:54:27 EDT 2004

Hello, fellow GHCees,

I am currently co-developing a language[1] as an extension to Haskell, by 
means of a preprocessor to GHC. In this language we want to supply the 
programmer with a number of functions by default, as with the functions in 
the GHC Prelude.
Is there some simple way to make GHC treat our own base library in the same 
magic way as the Prelude, so that it is always implicitly available? Note 
that we don't want to exchange the existing Prelude for our own, we want to 
leave that one as it stands, rather we want one or more other libraries to 
be treated the same way as the Prelude.
If the answer is no, that cannot be done, I would humbly request this as a 
feature in upcomming versions of GHC, I believe it's generally useful 
feature to have. =)

And while I'm asking about magicks; In our language we have a special 
function, called "page", that we require be present in "executable" modules, 
much like a main-function. Once again, is there some way of tweaking GHC to 
check this for us? We cannot simply use a 'main-is' flag since this function 
is not executed the same way that a main function would be, and its type 
should not be IO ().
I don't expect to be able to tell GHC what function must have what type with 
a command line flag, but is there some other way?

Any leads are appreciated, even if they only lead into the source code of 

/Niklas Broberg

[1] Haskell Server Pages:

The new MSN 8: advanced junk mail protection and 2 months FREE*

More information about the Glasgow-haskell-users mailing list