[Yhc] Re: Issue 122 in project yhc

Neil Mitchell ndmitchell at gmail.com
Sat Feb 24 09:48:23 EST 2007


Hi


> > case (local,res) of
> >     ([x], _) -> return x
> >     (_, [x]) -> return x
> >     ([], []) -> raiseError $ ErrorFileNone noErrPos askMsg file rs
> >     (as, bs) -> raiseError $ ErrorFileMany noErrPos askMsg file (map
> > anyOne (as ++ bs))
> > ...

> You are right, my patch is wrong. Here are some additional notes: At some
> point, I had getModule reporting additional information using:
>
> ... raiseError $ ErrorFileMany noErrPos (askMsg++" (as,bs)=<"++show
> (as,bs)++">") file (map anyOne (as ++ bs))
>
> This resulted in the following:
>
> Thorkil-Naurs-Computer:~/tn/test/Yhc/multiple thorkilnaur$ yhc T1.hs
> yhc: Error: Found file multiple times, T2
> Reason: imported from Main (as,bs)=<([],[])>
> Found in:
>
> Thorkil-Naurs-Computer:~/tn/test/Yhc/multiple thorkilnaur$

That is absolutely bizare!

> This indicates that the ghc-6.6 pattern matching is not working as we expect.

I would be shocked if pattern matching was broken in GHC, that is a
fairly fundamental aspect of GHC! That said, I can't think of anything
else off hand...

Can you please try:

> cd src/compiler98
> touch Package.hs
> ghc Package.hs -i.;../../depends/filepath -c -fext-core

Then send me Package.hcr, and I can see what GHC's translation is.
With any luck that (and a whole load of pain!) will let me figure out
what GHC is actually doing.

Thanks

Neil


More information about the Yhc mailing list