Removing the .Safe modules from vector (was: Haskell Platform proposal: Add the vector package)

Roman Leshchinskiy rl at cse.unsw.edu.au
Thu Aug 30 11:09:45 BST 2012


Johan Tibell wrote:
>
> If that's the case, and if Roman agrees, I suggest we release a new
> major version that
>
>  * removes all the .Safe modules [1],
>  * adds new .Unsafe modules, and
>  * marks the functions that are now exported through the .Unsafe
> modules deprecated in their original (non-.Unsafe) location.
>
> I suggest that the deprecation doesn't involve an actual deprecation
> pragma in this release [2], but instead just a comment. A future major
> release could add the deprecation pragma and another major release
> after that could remove the actual functions.

As I said earlier, I will definitely remove the .Safe modules. I'm not
particularly keen on adding .Unsafe modules but in the scheme you're
proposing, they'll just reexport a few functions and are (hopefully) easy
to generate automatically so if there really is demand for it, I'll add
them. Although I'd like to point out that with these scheme, vector won't
have any SafeHaskell-safe modules so I'm not entirely sure what the point
is, given
that the entire discussion was because people objected to removing support
for SafeHaskell.

A caveat: I will only add the .Unsafe modules if they are generated
automatically. I *hope* that's easy to do but can't make any promises as
to how long it will take at this point. If someone else wants to have a go
at automatic generation, I'll gladly accept patches.

However, I'm not sure how to add the deprecation comments. I'll end up
with this:


module Foo (unsafeFoo) where

unsafeFoo :: Very Long Type
unsafeFoo = ...


module Foo.Unsafe(unsafeFoo) where
import Foo


How do I make Haddock say that unsafeFoo is deprecated in the docs for Foo
but not in the docs for Foo.Unsafe? Or is this impossible and will I have
to do this?


module Foo (unsafeFoo) where

-- | (Deprecated) Very long comment
unsafeFoo :: Very Long Type
unsafeFoo = ...


module Foo.Unsafe(unsafeFoo) where
import qualified Foo

-- | Very long comment
unsafeFoo :: Very Long Type
{-# INLINE unsafeFoo #-}
unsafeFoo = Foo.unsafeFoo


Last question: do the +1 comments mean "yes, sounds good" or "yes, this is
something I will use"?

Roman






More information about the Haskell-platform mailing list