Re: Trex and module system

Ross Paterson <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Message-ID <[email protected]>
On Tue, Feb 18, 2003 at 11:51:06AM -0800, Iavor S. Diatchki wrote:
> the recent updates of the module system seem to have broken Trex.
> the problem is that Hugs.Trex tries to export "EmptyRec" which is a data 
> constructor and so cannot be named explicitly in an export list.
> (interestingly enough the Prelude does the same, but no error seems to 
> occur)

There's an ugly hack for the prelude, so (:) and EmptyRec can escape.
(Another consequence: if you import Prelude(), you don't even have (:)).

> a quick fix that seems to work is to change the Hugs.Trex module as follows:
> 
> module Hugs.Trex( module Hugs.Trex ) where
> 
> import Hugs.Prelude as Hugs.Trex -- ( Rec, EmptyRec, EmptyRow )
> 
> of course now Trex exports the whole of the Prelude, but hey it is a 
> quick fix :-)

I think the problem is that EmptyRec isn't a real constructor (it has
type Rec EmptyRow, not Rec r), and the fix should be to add

	emptyRec = EmptyRec

and export that instead of EmptyRec (and maybe change the Show instance
to match).
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.