[Haskell-cafe] Re: [Haskell] Top Level <-
gale at sefer.org
Wed Sep 3 08:42:18 EDT 2008
>>>> For the short term - can we *please* get an ONLYONCE pragma that has
>>>> the correct semantics?
Sittampalam, Ganesh wrote:
> How do you propose that this pragma would be implemented?
As far as I know now, in GHC it could currently just be
an alias for NOINLINE, but the GHC gurus could say for sure.
Except it should require a monomorphic constant - otherwise
the guarantee doesn't make sense.
And it would have clear comments and documentation
that state that it guarantees that the value will be computed
at most once. That way, bugs could be filed against it if
that ever turns out not to be true.
Other applications and libraries that support the pragma -
such as other compilers, and hs-plugins - would be required
to respect the guarantee, and bugs could be filed against
them if they don't.
More information about the Haskell-Cafe