Describe the option you'd like to add
- name:
let-style
inline: first definition is on the same line as let; subsequent definitions are aligned to this definition. If there's an in clause, in is aligned with start of let column, in contents is aligned with let definitions (i.e. 2 spaces after in)
inline-ormolu: Same as inline, except if there's an in clause, in is aligned with end of let column (i.e. 1 space before and after in)
auto-newline: inline when there's only one let binding, otherwise newline
newline: first definition is on the line after let, indented once, with subsequent definitions aligned to this definition. If there's an in clause, in is aligned with start of let column, and the in contents start on the next line, indented once
- Ormolu configured with
inline-ormolu
- I think default behavior should be
auto-newline, but open to suggestions.
Show a code example exemplifying the different option settings
-- inline
-- note that the space before the `in` is moved to after, not just removed
let a = 1
b = 2
in a + b
-- inline-ormolu
let a = 1
b = 2
in a + b
-- auto-newline (indent=2)
let a = 1
in a + 2
-- newline (indent=2)
let
a = 1
in
a + 2
-- auto-newline + newline (indent=2)
let
a = 1
b = 2
in
a + b
-- auto-newline + newline (indent=4)
let
a = 1
b = 2
in
a + b
Notes:
- With
newline, we won't support aligning in with the end of let; it just doesn't really look good. Originally, I wrote this issue where there were multiple independent toggles, but pretty much nothing else looked good. Happy to hear other suggestions as well.
- If someone adds the
in clause in a do-block, we'll change "in " to " in" for everything, since keeping it on the same level as let is invalid do-syntax
Describe the option you'd like to add
let-styleinline: first definition is on the same line aslet; subsequent definitions are aligned to this definition. If there's aninclause,inis aligned with start ofletcolumn,incontents is aligned withletdefinitions (i.e. 2 spaces afterin)inline-ormolu: Same asinline, except if there's aninclause,inis aligned with end ofletcolumn (i.e. 1 space before and afterin)auto-newline:inlinewhen there's only oneletbinding, otherwisenewlinenewline: first definition is on the line afterlet, indented once, with subsequent definitions aligned to this definition. If there's aninclause,inis aligned with start ofletcolumn, and theincontents start on the next line, indented onceinline-ormoluauto-newline, but open to suggestions.Show a code example exemplifying the different option settings
Notes:
newline, we won't support aligninginwith the end oflet; it just doesn't really look good. Originally, I wrote this issue where there were multiple independent toggles, but pretty much nothing else looked good. Happy to hear other suggestions as well.inclause in a do-block, we'll change"in "to" in"for everything, since keeping it on the same level asletis invaliddo-syntax