Skip to content

More code actions when a default method implementation doesn't work #3135

Open
@akshaymankar

Description

@akshaymankar

Is your enhancement request related to a problem? Please describe.

When writing code like this:

instance FromJSON Foo

This produced an error about Foo not having an instance for Generic due to the default implementation of parseJSON and HLS sugests that I make the line look like

instance Generic Foo => FromJSON Foo

This is almost never what anyone wants to do for most type classes.

Describe the solution you'd like

I understand that in the general case, this might be a good idea, like when the constraint is on a parameter of the type in question. So this suggestions shouldn't be removed. I think having these two other suggestions would be greatly helpful for me:

  1. A suggestion to add placeholders for the missing methods, like the hls-class-plugin does.
  2. A suggestion to add another instance for the type instead of just the constraint.

Describe alternatives you've considered

N/A.

Additional context

N/A.

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