avoiding recursive `let` bindings
Since GHC 8.0, there's no way to prevent let bindings from being recursive. This is a not-uncommon source of bugs. One workaround (for part of the problem) is to chain lets, like
let x = 7 in
let y = x in
let z = y in
z
With Ormolu, this very quickly results in deep nesting, as each let introduces two levels of indentation.
let x = 7
in let y = x
in let z = y
in z
This is perhaps related to #575, although the underlying justification is different and not all of the approaches there help here.
I actually prefer Ormolu's formatting, and wish GHC would fix this problem internally (like in https://gitlab.haskell.org/ghc/ghc/-/issues/14527). However, until then, it feels like Ormolu is discouraging this workaround.
I'm not sure what a solution looks like. Maybe there's a different approach to avoid the underlying problem that'll work better with Ormolu's current style, or maybe there's a formatting that makes everyone happy XD