lspitzner / lspitzner/brittany
Configuration option to always hang guards/where
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 686
- Forks
- 69
- PR merge metrics
- No merged PRs in 30d
Description
Apologies if this already exists, but I wasn't able to find anything obvious in the docs or code to force guards and where clauses to always be hung on the next line. For example, I'd like code to be formatted as follows:
foo = blah
where
intersectBM (Bin p2 m2 l2 r2)
| nomatch p2 m2 = Nil
Currently after formatting it will look like:
foo = blah where intersectBM (Bin p2 m2 l2 r2) | nomatch p2 m2 = Nil
It appears that if all the guards/where clauses fit without overflowing the column limit then they are aligned on the right. Thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the formatter's handling of guards and where clauses, along with its configuration documentation and code. Trace why clauses remain inline when they fit within the column limit. Done means a configuration option forces these clauses onto the next line and the reported example formats as shown.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100