purescript-st
purescript-st copied to clipboard
Remove `STRef`, unify with `Ref`
Now there's the Global
region, MonadST
, etc. we can do away with having two Ref
types:
- Rework
Ref
inpurescript-refs
to includeRegion
(basically,STRef
->Ref
) - Introduce a
Ref.Lifted
module where the operations have aMonadST
constraint so they can be used inEffect
without friction. - Remove
STRef
frompurescript-st
- Remove the
MonadRec
instance currently inpurescript-st
, as it currently is implemented withSTRef
. Implement it inpurescript-tailrec
instead (implementation is basically identical to theEffect
instance already in there).
I've done all this locally to check it works out 🙂.
I'd like to make this change when we do the updates for PS 0.14 unless there is a strong feeling we shouldn't for some reason. Aside from some module stuff moving around the main breaking difference is that existing Ref
s will need to become Ref Global
.