Nancy Day <[EMAIL PROTECTED]> writes: > > Hi -- > > I've been using green-card 2.0 with hugs version March 1999 (990319). > The .hs file that green-card generates imports the Prelude > qualified but uses the monad combinators (return, >>=) unqualified. > It's pretty easy to work around this problem, but it would be > good to fix it in the distribution. > Hi, I'm guessing you're using GreenCard to process something like the following: foo$ cat sin.gc module Sin where import qualified Prelude import StdDIS %fun sin :: Float -> Float foo$ and it is failing..? Yes, ideally, GreenCard should be able to handle that without incident, but it's a preprocessor and mostly unaware of the facilities of the Haskell module system. I don't propose to fix this, since Haskell98 goes a long way towards solving the underlying problem with its lazy reporting of name clashes, i.e., make the Prelude import unqualified and you *should* be OK...at least if you're using a Haskell98 compliant system. Neither ghc-4.02 nor the hugs98 snapshot (990319) I've got handles this correctly though, i.e., the following isn't accepted module Sin where sin :: Float -> Float sin x = x but should be with my interpretation of the relevant sections of the H98 report - both mentions of 'sin' can be unambiguously resolved. I've fixed this in the development sources for ghc, but, for now, you may just want to use "hiding" instead of "qualified" in your GC spec. Thanks for the (indirect!) bug report. --sigbjorn
RE: green-card problem when using hugs
Sigbjorn Finne (Intl Vendor) Tue, 27 Apr 1999 19:54:54 +0200 (MET DST)
- green-card problem when using hugs Nancy Day
- Sigbjorn Finne (Intl Vendor)
