Skip to content

Feature Request: Case-split QuickFix on pattern argument #1643

@konn

Description

@konn

As reported in #1602, typed holes make typechecking significantly slower.
It might be good if we can invoke the powerful Wingman without using holes if possible.

I think one such example is case split tactic. Consider the following:

foo :: Maybe a -> Int
foo may = ...

I think we can provide Case split on may on may in Line 2.
One thing that we must think is the treatment of the function body.
If the function body is mere typed hole _, we can copy them as-is.
If the ... part contains some other contents, we have a few options:

  1. Copy the body as-is, regardless of the occurrence of may.
  2. Replaces all the occurrence of may with destructed value.
  • This won't work if the destructed constructor contains implicit existential variables which cannot be determined from the type of its arguemtns.
  1. Copy the body as-is and prefixing each destructed pattern with as-patterns; e.g. may@(Just mayj).
    • We might omit as-patterns if there is no occurrence of may.

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