Skip to content

Conversation

@isovector
Copy link
Collaborator

Another hot feature requested by @TOTBWF. This PR adds a new code action that performs a case split on all bound function arguments. For example, given:

and :: Bool -> Bool -> Bool
and = _

it will produce

and :: Bool -> Bool -> Bool
and False False = _
and True False = _
and False True = _
and True True = _

@isovector isovector added the merge me Label to trigger pull request merge label Mar 1, 2021
@googleson78
Copy link
Contributor

A more modular approach taken in Agda is to be able specify which arguments to split on in the hole (or prompt the user to input them). So for Haskell it might look something like

f x y z = _x_y
-- case split action results in all the cases for x and y only

Not sure if we have hole info though, and if the "advanced hole info stuff" by @Tritlo even is merged in ghc.

@mergify mergify bot merged commit 73daeaa into haskell:master Mar 1, 2021
@isovector isovector deleted the split-all branch March 1, 2021 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge me Label to trigger pull request merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants