Skip to content

Merge Effect and ST #31

Open
Open
@garyb

Description

@garyb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    purs-0.15A 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions