purescript-st icon indicating copy to clipboard operation
purescript-st copied to clipboard

Remove `STRef`, unify with `Ref`

Open garyb opened this issue 4 years ago • 9 comments

Now there's the Global region, MonadST, etc. we can do away with having two Ref types:

  • Rework Ref in purescript-refs to include Region (basically, STRef -> Ref)
  • Introduce a Ref.Lifted module where the operations have a MonadST constraint so they can be used in Effect without friction.
  • Remove STRef from purescript-st
  • Remove the MonadRec instance currently in purescript-st, as it currently is implemented with STRef. Implement it in purescript-tailrec instead (implementation is basically identical to the Effect 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 Refs will need to become Ref Global.

garyb avatar Mar 07 '20 14:03 garyb