Haskell Platform proposal: Add the vector package

Antoine Latter aslatter at gmail.com
Sun Jul 15 14:44:16 BST 2012


On Sat, Jul 14, 2012 at 11:03 PM, Mark Lentczner
<mark.lentczner at gmail.com> wrote:
> At the risk of throwing more wood on the fire here - I went back and looked
> at Vector and now I see that there are large set of ".Safe" variants that
> are no more than re-exports of the exact same functions from the non .Safe
> versions of the modules with an extra safe haskell declaration added. What
> is the point of this? Shouldn't the declaration just be on the normal module
> (safe or trustworthy). Do we really need .Safe versions of all the modules?
> If we don't, please, let's take these out of the package before committing
> it to the platform (where we have to make a commitment to the API). If we do
> need these modules to support Safe Haskell --- then something is seriously
> wrong with the either construct, or the way vector is using it.
>

I was going to use the Data.Vector.Fusion.Stream module to explain why
this was done, but that's a bad example because I don't see anything
unsafe (from a SafeHaskell perspective) in the nonSafe module.

I better example would be "Data.Vector.Generic.Mutable" - it exports
the function "unsafeWrite" which can poke data into arbitrary memory
offsets. So the module shouldn't be marked as trustworthy, but the
majority of the symbols are things that should be usable from
SafeHaskell. Hence the "Safe" module.

The better solution would have been to break the API and move
dangerous functions into "Unsafe" modules.

> I think the state of affairs stinks. It will do nothing but confuse the heck
> out of users - and present exactly what the platform is there it remove:
> uncertainty and instability.
>
> - Mark
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>



More information about the Haskell-platform mailing list