Jon Mountjoy writes:
> Hello People
> 
> One problem:
> 
> > main = putStrLn "Foo \
> >         \mar"
> 
> Doesn't compile with: ghc -c -cpp Main.lhs
> Main.lhs:5:23: Illegal string escape: `\m'
> Main.lhs:5:23:  on input: "m"
> 
> The cpp seems to be doing something nasty, perhaps hoisting the second
> line and eliminating the first slash?
> 

Hi,

yes, string gaps and -cpp doesn't work very well together - there's
even a word of warning regarding this in the user's guide.

> One suggestion:
> ---------------
> I have just spent an hour tracking down a rather silly "undefined".
> Whenever I ran my program, bam: undefined.
> 
> Could we perhaps change the GHC implementation, (and perhaps the
> standard) on the following:
> 
> Page 23 of the report says "Fields not mentioned are initialized to
> \bottom" on the subject of Datatypes with Field label.
> 
> :-(
> 
> Perhaps, we can implement bottom with 
> > error "Fieldname foobar not initialised" 
> instead of
> > undefined
> It would make the language a little friendlier.
> 

I agree completely, but doesn't it do this already? The record
construction code does insert descriptive error thunks for the
undefined fields (post-2.01 - I don't have a working 2.01 build at
hand). Do you have an example that reproduces the (mis-)behaviour you
were seeing?

--Sigbjorn

Reply via email to