Indented root layout not supported?
postsolar opened this issue · comments
postsolar commented
module M where
i :: Int
i = 1
purs-tidy check src/M.purs
replies with
Some files have errors:
/home/me/purs-test/src/M.purs:
[6:1] Unexpected end of file
JordanMartinez commented
I'm pretty sure that's just invalid syntax. Top-level declarations cannot be indented.
postsolar commented
It compiles fine though?
https://try.purescript.org/?code=LYewJgrgNgpgBAWQIYEsB2cDuALGAnGAKELjhTgC4K4BJNAFxLLgF44BGQoA
Gary Burgess commented
This syntax was definitely supported originally because we allowed multiple modules per file, so you'd have like
module X where
def1 :: ...
module Y where
def2 :: ...
so it may have been preserved since then in the main compiler.
Nathan Faubion commented
I wouldn't recommend writing code this way as it's completely unnecessary (I personally think some kind of syntax error is appropriate), but if the main compiler supports it, we probably should as well.