weird compiler bug/failed to load interface

Hal Daume III hdaume@ISI.EDU
Fri, 4 Jan 2002 09:36:26 -0800 (PST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-851401618-1010165786=:21171
Content-Type: TEXT/PLAIN; charset=US-ASCII

There's one module I wrote that I use in a lot of my programs and for some
reason, whenever I compile a program using this module with -O or -O2,
make changes to the Main, and then recompile, I get the following error
from ghc:

Skipping  Pattern          ( Pattern.hs, Pattern.o )

failed to load interface for `Pattern':
    Could not find interface file for `Pattern'

Failed to find interface decl for `Pattern.a'
from module `Pattern'

if I "ls Pattern.*" I get Pattern.hi, Pattern.hs and Pattern.o.

In order to get it to compile correctly, I have to rm Pattern.o and then
rerun ghc on the Main module.

I've attached the Pattern.hs fyi.  If anyone has any suggestions, please
let me know.  (btw, I'm using --make)

Thanks!

 - Hal

--
Hal Daume III

 "Computer science is no more about computers    | hdaume@isi.edu
  than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume

---559023410-851401618-1010165786=:21171
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="Pattern.hs"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.4.21.0201040936260.21171@moussor.isi.edu>
Content-Description: 
Content-Disposition: attachment; filename="Pattern.hs"

bW9kdWxlIFBhdHRlcm4gKFBhdHRlcm5FbGVtKC4uKSwNCgkgICAgICAgIHNl
ZWtQYXR0ZXJuLA0KCSAgICAgICAgZmluZFBhdHRlcm4pDQogICAgd2hlcmUN
Cg0KaW1wb3J0IENoYXINCg0KdHlwZSBQYXR0ZXJuID0gW1BhdHRlcm5FbGVt
XQ0KZGF0YSBQYXR0ZXJuRWxlbSA9IFBhdENoYXIgQ2hhciANCgkJIHwgUGF0
Q2FzZSBDaGFyDQoJCSB8IFBhdE51bSANCgkJIHwgUGF0QWxwaGENCgkJIHwg
UGF0QWxwaGFOdW0NCgkJIHwgUGF0QW55DQoJC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