Drastic Prelude changes imminent
Edward Kmett
ekmett at gmail.com
Wed Jan 28 23:12:28 UTC 2015
That is the one. =)
My previous thinking on this had been to figure out how to get deprecated
exports implemented early in 7.12, so we could put in a proposal to
libraries@ to use it to clean up the nonsensical generalizations of the
Data.List combinators, and go back and address several Control.Monad
re-exports like, mapM and the mtl Monad re-exports in 7.14.
That would make it easier to use push towards a world where we _can_
implement something like an alternate Prelude as mostly an import-only
decision in the future.
For all that I don't see a good way to deal with Foldable/Traversable
changes in such a manner at this point, I happen to agree in general with
the approach that Neil espouses about how to evolve the language, and
removing barriers such as these to eventually following that model would be
more or less an unmitigatedly good thing.
Now, if we could get deprecated exports earlier we could theoretically put
those deprecations in place now.
But it seems to me that putting even that mechanism in place and agreeing
on a plan of action around how to use it would be a lot to cram in to try
to add here at the very end of 7.10 and risks missing cases, like we did
when we rushed out the AMP warnings at the end of 7.8.
The benefit of going down that road rather than a WEAK pragma is that it
avoids introducing a new mechanic for how name resolution works that
complicates the language, a deprecated export pragma by way of comparison
is generally useful and can be ignored by compilers that don't understand
it, even when used in third-party code.
The benefits of a WEAK pragma is that it _could_ be shored up and made a
part of the language, but it is admittedly a rather odd pragma. Adding such
a construction is a topic that has come up a few times before with lukewarm
reception. Most existing pragmas can be sensibly ignored by compilers that
don't know about them. By way of comparison existing pragmas like
SPECIALIZE, SOURCE, [NO]INLINE, UNPACK, WARNING, DEPRECATED, etc. don't
change the way names resolve for the entire program.
It seems a messy solution to rush a language extension in that we may
regret later and simultaneously break all of the code that has already been
made 7.10-ready.
-Edward
On Wed, Jan 28, 2015 at 5:33 PM, Herbert Valerio Riedel <hvr at gnu.org> wrote:
> On 2015-01-28 at 18:35:01 +0100, Edward Kmett wrote:
>
> [...]
>
> > Adding to GHC the ability to complain if a given re-export is the only
> way
> > a symbol finds its way into scope that you use, and apply those flags to
> > Control.Monad.mapM and a bunch of combinators in Data.List.*.
>
> ...I think the 4-year-old #4879 GHC ticket covers that ability?
>
> [1]: https://ghc.haskell.org/trac/ghc/ticket/4879
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20150128/e1162ec2/attachment-0001.html>
More information about the Libraries
mailing list