-
Notifications
You must be signed in to change notification settings - Fork 141
Open
Description
The constructor of MVector
is exposed:
data MVector s a = MVector !Int !Int !(MutableArray s a)
This seems pretty odd, because the two Int
s are the offset into the underlying MutableArray
that the MVector
starts, and the length of the MVector
. both of which are used for bounds checking before deferring to readArray
of a MutableArray
via basicUnsafeRead
.
So I'm confused. Firstly, can changing those fields not lead to segfaults? And secondly, doesn't changing those fields have no real purpose, since there are better ways of obtaining the ends one wants via the safe API (or even the unsafe one, with functions explicitly named as "unsafe
" if one really wants the performance)?
Or have I missed something, and there is a good reason for exposing those fields?
Metadata
Metadata
Assignees
Labels
No labels