Sven Panne <[EMAIL PROTECTED]> wrote,
> Just a thought: Some compilers for other languages (e.g. Java and
> Eiffel) warn the user about deprecated features, but continue
> compilation. Given the current state of flux in the Haskell libraries,
> this would be a nice thing in Haskell, too. So my suggestion is a new
> pragma DEPRECATED along the following lines:
>
> * The module Char could contain (everyone who has ported an older
> program to H98 knows what I'm talking about :-) :
>
> {-# DEPRECATED isAlphanum: Use isAlphaNum instead #-}
> isAlphanum = isAlphaNum
>
> * Whole module can be deprecated, too, e.g. GHC's GlaExts:
>
> {-# DEPRECATED: Use IOExts instead #-}
>
> Compilers/Interpreters should issue the message behind the colon when
> such an identifier/module is (directly) used, continue their work.
>
> Definitely not a candidate for the next Turing Award, but very helpful,
> anyway... Opinions?
Good idea. The only problem is the pollution of the name
space when deprecating a function - eg, I might define
`isAlphanum' in a H98 program and expect it not to clash
with anything in `Char'. So, for this really to be useful,
user definitions should be able to shadow deprecated
definitions, which makes the status of the annotation as a
pragma questionable.
The situation is different in non-standard libraries, there
the feature would be helpful even if deprecated functions
still clash with user-defined functions.
Cheers,
Manuel