purescript-foreign-object
purescript-foreign-object copied to clipboard
Inconsistencies with Record.ST and Data.Array.ST
There’s a few inconsistencies between Foreign.Object.ST, Record.ST and Data.Array.ST:
- Foreign.Object exports thawST, freezeST and runST whereas those functions are exported as thaw, freeze and run from Data.Array.ST and Record.ST (there’s actually no Record.ST.run yet but I proposed to add it in https://github.com/purescript/purescript-record/issues/68).
- Record.ST and Data.Array.ST export a modify function but Foreign.Object.ST does not.
- Foreign.Object.ST.Unsafe exports only an unsafeFreeze function, but no unsafeThaw like Data.Array.ST.Unsafe (I also proposed exporting both unsafeFreeze and unsafeThaw from a new Record.ST.Unsafe module in https://github.com/purescript/purescript-record/issues/68).
Should we make this package more similar to the others, or the other way around perhaps?
Exporting thawST, freezeST and runST as thaw, freeze and run from Foreign.Object.ST isn’t that straightforward because then Foreign.Object.ST must import Object from Foreign.Object, incurring a circular dependency because some functions in Foreign.Object are implemented with mutations for efficiency.