autoformat icon indicating copy to clipboard operation
autoformat copied to clipboard

Improve automatic vertical alignment

Open HarrisonGrodin opened this issue 5 years ago • 0 comments

At the moment, the => in rules are vertically aligned. We should attempt similar treatment in a variety of cases, including some or all of the following:

  • fun declarations
fun foo (0 : int) (y : string) = y
  | foo _         (z as y')    = ""
  • and bindings
datatype    stuff  = Foo | Bar of bar
     and 'a things = Some | Other of 'a | Constructors
  • tuple/list/record patterns
fn (SOME x, SOME y) => x + y
 | (SOME x, NONE  ) => x
 | (NONE  , SOME y) => y
 | (NONE  , NONE  ) => 0

case e of
  (1   , _) => "a"
| (2345, _) => "b"
| _         => "c"

HarrisonGrodin avatar Aug 16 '20 02:08 HarrisonGrodin