id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
3895,"""Fix"" pervasive-but-unnecessary signedness in GHC.Prim",pumpkin,,"I'm talking about the array primitives in particular:

{{{
writeFloatArray# :: MutableByteArray# s -> Int# -> Float# -> State# s -> State# s
}}}

Conceptually, a Word# makes more sense as the index for all the array functions. I'm not even sure what the semantics are if the Int# is negative... is it checked? The three scenarios I can think of are:

Negativity is checked, and you get an exception.
Negativity is unchecked, and you get to write to memory that comes before your array.
Negativity is ignored, and the back-end treats the Int# like a Word# already.

I think the switch would be worthwhile in all of those cases, and could be hidden in higher-level APIs that still use Int for indexes with a simple int2Word#. Eventually we might even migrate to Word-based APIs at that level?",feature request,new,low,7.6.2,Compiler,,,,,Unknown/Multiple,Unknown/Multiple,None/Unknown,,,,,
