ipso icon indicating copy to clipboard operation
ipso copied to clipboard

Let binding blocks

Open LightAndLight opened this issue 4 years ago • 0 comments

Currently this is valid:

main =
  let
  x
  =
  1
  in
  ...

The indents for each token are treated as spaces, so the let expression recognised.

I might want to prevent this. The alternative is to have the binding start a 'block', so that the = 1 tokens have to be indented further than the name.

For example,

main = 
  let
  x
    =
    1
  in
  ...

would be valid, but the first example wouldn't be.

This also makes it easier to implement multi-binding lets:

let x = 1
    y = 2
in
...
let
  x = 1
  y = 2
in
...

The block should require all binding names to start in the same column.

LightAndLight avatar Oct 24 '21 02:10 LightAndLight