haskell / haskell/haskell-language-server

Case-split to handle `\cases` expression and function definitions

Open
#5,068 1 comment 0 reactions 0 assignees View on GitHub
component: hls-case-split-plugin type: enhancement
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
3d 21h
Merged PRs (30d)
13

Description

So far the plugin can split on `case` and `\case` expressions.

It would be nice if it could split on `\cases` expressions and function definitions as well.

Clearly, the number of alternatives to add is the product of the number of alternatives the arguments, so a split on a function definition of type `Bool -> Either () Bool -> a` would necessitate 6 alternatives. Maybe having a limit on the total number of alternatives to generate is not a totally bad idea. I don't know.

Originally considered during [my GSoC 2026 project](https://gist.github.com/Aster89/69a57c364ec2d0cc89f474cc3d194371#future-work--stretch-goals).

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no files, tests, or entry point. Start by locating the plugin code and tests for splitting on `case` and `\case`, then trace how alternatives are generated for the requested `\cases` and function-definition forms. Done means both forms split correctly, with the alternative-count behavior and any generation limit addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.