[Yhc] Re: Yhc Digest, Vol 14, Issue 3
Christopher Lane Hinson
lane at downstairspeople.org
Wed Jan 10 22:47:51 EST 2007
> An instance Functor Maybe was missing, and I tried to add it to
> Prelude (where both Functor and Maybe are defined, to avoid orphan
> instance issues). It turns out, every time Prelude.hs is recompiled,
> its interface file is overwritten with one from bootstrap. What is the
> purpose of this? I'd assume the opposite: if Prelude got recompiled,
> the bootstrap interface has to be updated, so one getting a clean
> distribution would have prelude interface intact. Is this an error in
> SConscript? Or am I missing something?
>
> For now, I just commented out three lines in SConscript responsible
> for the yhc-base package compilation. The new instance is now visible.
>
> I haven't committed this to the central repo; I'd like to get some
> explanation of this first.
I also haven't submitted a patch that also had to implement instance
Functor Maybe. We seem to have a very similar problem.
>> Apparently there are problems with orphan instances, and perhaps
>> passing -prelude when compiling the file with the instance in it will
>> work. If that doesn't work email the list, since its probably an nhc
>> issue originally.
For clarity:
I did a quick test. I think that orphan instances work when they involve
non-prelude names. What I was told by someone else is that all names
that appear in the prelude might not be exported unless -prelude, which
is a different problem.
I originally suggested that orphan instances didn't work because it didn't
occur to me that prelude names would be given special treatment.
--Lane
More information about the Yhc
mailing list