why do Getter results live in Eff?
matthewleon opened this issue · 4 comments
matthewleon commented
These should be safe, read-only operations. Is wrapping the result in Eff necessary?
jacereda commented
I'm not sure about this. Could the compiler, in a case like this:
DV.setUint8 dv 0 123
let a = DV.getUint8 dv 0
DV.setUint8 dv 0 456
let b = DV.getUint8 dv 0
be free to reorder the getters in a way that yields unexpected results for that code?
matthewleon commented
Ah I see. I think the issue here might be that what these Effs are doing is ST type stuff.
I'm working on a fork of this where I adopt the approach used here: https://pursuit.purescript.org/packages/purescript-arrays/4.0.1/docs/Data.Array.ST
I think that might be fruitful.
jacereda commented
Great, freeze/thaw seems the way to go.
matthewleon commented
Implementing the ST approach here: https://github.com/matthewleon/purescript-arraybuffer-safe