Skip to content

Haskell fixer: curried constraints #4

@aspiwack

Description

@aspiwack

When attempting to repair a missing constraint, we end up with curried constraints:

foo :: (A, B) => C -> D

bar :: C -> D
bar c = foo c
-- after two repairs, the type of bar is:
--     bar :: A => B => C -> D

While this is entirely correct, it is not idiomatic, so I was wondering if it was possible to detect existing constraints, add parentheses if needed, and insert constraints after the first one in the parentheses so that repair would yield

bar :: (A, B) => C -> D

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions