On 11 July 2012 23:46, Henning Thielemann <lemm...@henning-thielemann.de> wrote:
>
> On Wed, 11 Jul 2012, Bas van Dijk wrote:
>
>> The ideal, but currently, impossible way of dealing with this is to
>> mark the _export_ of unsafe functions in a module as DEPRECATED and in
>> a later version remove the unsafe functions and mark the module as
>> Trustworthy. However this requires support for deprecating exports:
>
>
> We can easily re-define functions, like
>
> module Old where
>
> import MyMod.Unsafe as Unsafe
>
> {-# DEPRECATED "unsafeDoSomething" #-}
> unsafeDoSomething :: a -> b
> unsafeDoSomething = Unsafe.unsafeDoSomething
>
>
> Do we really need deprecating exports?

As explained in the ticket #4879 this will probably lead to lots of
"ambiguous occurrence of unsafeDoSomething" errors since users will
probably import both Old and MyMod.Unsafe. The only way to guard
against this is to use qualified imports. Lots of people don't use
them however.

Bas

_______________________________________________
Haskell-platform mailing list
Haskell-platform@projects.haskell.org
http://projects.haskell.org/cgi-bin/mailman/listinfo/haskell-platform

Reply via email to