[Haskell-cafe] Re: [Haskell] Top Level <-
Ashley Yakeley
ashley at semantic.org
Fri Sep 5 05:07:52 EDT 2008
Sittampalam, Ganesh wrote:
> Sounds plausible, although dynamic relocations do slow down linking.
>
> Unloading is another interesting problem. Are we allowed to re-run <-
> if the module that contained it is unloaded and then reloaded? I'm not
> quite sure what the conditions for allowing a module to be unloaded
> in general should be, though.
Interesting question. I suppose it's allowable if the guarantees
attached to the ACIO type imply that it would not be possible to tell
the difference.
I think this means that all values of types, including newtypes,
belonging to the module must be unreachable before unloading. Consider
Data.Unique as a separate loadable module. It's loaded, and various
Unique values are obtained. But Unique is just a newtype of Integer, and
comparison between Uniques doesn't use code from Data.Unique. This might
be difficult to track as once the newtype is boiled away, the code is
basically dealing with Integers, not Uniques.
I really don't know enough about the RTS to know. The alternative would
be to keep all initialised values when the module is unloaded. I'm
guessing this is more feasible.
--
Ashley Yakeley
More information about the Haskell-Cafe
mailing list