Skip to content

Indent post-guard expression one level more #806

@brandonchinn178

Description

@brandonchinn178

Is your feature request related to a problem? Please describe.
Currently, expressions are indented just one more indentation level after a guard, which makes me confuse the guard from the expression. e.g.

foo mx
  | Foo x <- mx = do
    Foo x' <- bar x
    return x'
  | otherwise = do
    putStrLn "hello"
    putStrLn "world"

When I look at this, my eyes glaze over the | and just see 6 lines at the same indentation level.

Describe the solution you'd like
I think it's less confusing for it to be indented one more, e.g.

foo mx
  | Foo x <- mx = do
      Foo x' <- bar x
      return x'
  | otherwise = do
      putStrLn "hello"
      putStrLn "world"

To me, this is much clearer, as it clearly separates the guard from the expression. I can clearly see two guards, with two lines of expression each, whereas before, I saw 6 lines of guards/expressions?

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

Labels

styleNitpicking and things related to purely visual aspect for formatting.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions