Skip to content

Use type signature: Don't insert excess parentheses . #2674

Closed
@AndreasPK

Description

@AndreasPK

When completing a type signature HLS is very conservative and always adds parentheses around the actual type.

For example something like myHead :: [a] -> _ will get a type of myHead :: [a] -> (a). Note the parentheses around the a.

While I personally don't have a big problem with this. Many of my colleagues insist on them being removed. Which usually makes these signatures easier to read!

Describe the solution you'd like

Ideally I would like the inserted type signature to be the one with the least parentheses. For example Just _ will require braces if the inserted type is Either Int Char. But if it's just Char there is no need for them. But in something like a -> _ -> ... then we can get away without braces for Either Int Char!

It's likely not trivial to achieve this. But it would be really nice.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions