<div dir="ltr"><div>On Wed, Jul 11, 2012 at 7:27 PM, Johan Tibell <span dir="ltr">&lt;<a href="mailto:johan.tibell@gmail.com" target="_blank">johan.tibell@gmail.com</a>&gt;</span> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">For example, most functions in bytestring are unsafe because their</div>
implementation uses unsafePerformIO. To be very concrete, if &#39;map&#39; on<br>
ByteStrings is unsafe it needs to be moved from<br></blockquote><div><br></div><div>While I share your distrust of the whole Safe Haskell movement as being a lot of effort for an unproven benefit from a definition of &quot;safe&quot; that is not demonstrated to be of practical usefulness or practical concern, I think you&#39;re wrong here.</div>
<div><br></div><div>unsafePerformIO is unsafe.</div><div><br></div><div>Data.ByteString.map is only unsafe if it allows unsafePerformIO to be abused.</div><div><br></div><div>If it can verify that nothing actually unsafe takes place — which it does, by dint of the promise inherent in it being exposed as pure — Data.ByteString.map is *not* unsafe.  The mechanical application of &quot;oh, it uses unsafePerformIO, we don&#39;t care whether it proves it has used it safely:  it must by definition be unsafe&quot; just complicates things even more.  If indeed it&#39;s not simply a strawman.</div>
<div><br></div></div>-- <br>brandon s allbery                                      <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a><br>wandering unix systems administrator (available)     (412) 475-9364 vm/sms<br>
<br>
</div>