Description
This is a idea for the future, floated by @natefaubion when we were talking about #30.
ST
and Effect
have the same implementation, and it should be possible to coerce safely in either direction (at first I thought runST
would essentially become unsafePerformEffect
when applied to an Effect
converted to ST Global
, but actually that won't type check). Given that, Effect
could just be what is currently ST 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 ST
things to work in Effect
(useful for STArray
, etc.).
With this unified thing, the somewhat obvious name for the type is Effect
, but we'd probably want to preserve the Type -> Type
version of Effect
we currently have so we don't have to perform an Eff
-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 Effect
to newbies unless we need to, which I agree with.