safe vs. unsafe (Was: Haskell Platform proposal: Add the vector package)

Simon Marlow marlowsd at gmail.com
Thu Jul 12 23:33:43 CEST 2012


On 11/07/12 22:43, Johan Tibell wrote:

> No, all functions that use unsafe functions need to be moved to an
> .Unsafe module if the former is to be marked as Safe (which is what's
> being proposed.) Every time a function changes to/from using an unsafe
> function (even if indirectly) it needs to be juggled back and forth
> between the two different modules.

In case it isn't clear yet, I just want to state for the record that 
this is *not* the case.  If there's some documentation or something that 
gives a misleading impression here, please let me know and I'll try to 
fix it.

The whole of Data.ByteString is safe. It's implementation is marked 
Trustworthy, because it uses unsafe APIs internally.  Data.ByteString 
can be used from Safe code just fine.

Cheers,
	Simon



More information about the Libraries mailing list