-
Notifications
You must be signed in to change notification settings - Fork 24
Merge Effect and ST #31
Copy link
Copy link
Open
Labels
purs-0.15A reminder to address this issue or merge this PR before we release PureScript v0.15.0A reminder to address this issue or merge this PR before we release PureScript v0.15.0type: breaking changeA change that requires a major version bump.A change that requires a major version bump.
Metadata
Metadata
Assignees
Labels
purs-0.15A reminder to address this issue or merge this PR before we release PureScript v0.15.0A reminder to address this issue or merge this PR before we release PureScript v0.15.0type: breaking changeA change that requires a major version bump.A change that requires a major version bump.
This is a idea for the future, floated by @natefaubion when we were talking about #30.
STandEffecthave the same implementation, and it should be possible to coerce safely in either direction (at first I thoughtrunSTwould essentially becomeunsafePerformEffectwhen applied to anEffectconverted toST Global, but actually that won't type check). Given that,Effectcould just be what is currentlyST Global.This would mean we have fewer cases to deal with in the optimizer, no need to implement two sets of essentially identical instances and functions, and avoid the need to explicitly coerce or lift
STthings to work inEffect(useful forSTArray, etc.).With this unified thing, the somewhat obvious name for the type is
Effect, but we'd probably want to preserve theType -> Typeversion ofEffectwe currently have so we don't have to perform anEff-to-Effect-worthy migration again, so we'd need to come up with something else.Nate also suggested that we'd want to wait until synonyms are preserved in error messages, since we don't want to reveal the underlying type for
Effectto newbies unless we need to, which I agree with.