Skip to content

Partial class opaqueness #2248

@texastoland

Description

@texastoland

I've been struggling to debug unexpected Partial constraints. I'll chime in on a related issue about a vague message related to binding groups. But at the root Partial acts like IO instead of Eff. There's no way to ascertain which parts of a type contributed to the whole type being inexhaustive. A naive example is Partial => Tuple (Mabye a) (List a). Was Maybe or List missing a case? Regardless unsafePartial clears them both. I initially thought it'd make APIs nicer like Data.Array.Partial.head. But any function calling head also becomes Partial if not handled with no way to express why using types (just documentation or a descriptive crashWith). Partial feels like an implicit Either a a flagging whether exhaustivity checking worked in a previous context without compiler verification what's left. I was also surprised it only works at the top level as opposed to inside a where. I don't know how to improve the design with parameters or preferably rows but wanted to raise it for discussion.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions