Skip to content

Make launchAff_ operate only on Aff Unit #202

@i-am-the-slime

Description

@i-am-the-slime

Problem

I’m finding launchAff_ to be quite dangerous. When I have an interface that requires an Effect Unit but I need to perform some network calls I usually provide the callback with launchAff_ . Now I ran into a situation where I used launchAff_ on an Aff (Either Error Unit) which is not what I intended. Do you think it would hurt much if launchAff_ only worked on Aff Unit values? That way it would be similar to the warning about implicitly discarding values in a do block.

Describe the solution you'd like

launchAff_ has the signature

launchAff_  Aff Unit  Effect Unit

Additional context
I'm aware that this should cause a major version bump since it's a breaking change. I'm hopeful however, that when this change requires somebody to change their code it will improve its clarity or even catch potential bugs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: 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