Skip to content

Use TypeError instances instead of current yaya-unsafe instances #83

@sellout

Description

@sellout

Right now, using instances from yaya-unsafe is very dangerous. They’re imported transitively, so once you include them, they’re available everywhere downstream.

Instead, all the instance from that package should be part of yaya proper as negative instances (using TypeError1). Then, yaya-unsafe should define newtype Unsafe and wrap all its existing instances in that newtype. Then, users can access them by wrapping the fixed-point in Unsafe without worrying about inflicting them on users further downstream.

Footnotes

  1. The error message should recommend yaya-unsafe’s Unsafe wrapper as a last resort after considering if you really need that operation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions