Open jiribenes opened 2 months ago
Related to https://github.com/effekt-lang/effekt/issues/287, as the following suggestion would make it a little bit more symmetric:
sequence constructors not with semicolons
type B { True(); False() }
buttype B { case True() case False() }
Maybe one more reason why it feels surprising:
def helloWorld() = {
def foo() = println("hello") def bar() = println("goodbye")
foo(); bar()
}
does not parse here (requires a newline between the two definitions), but parses fine in the cases outlined above.
The following program using a space to separate two operations (both in their definition and implementation) is currently syntactically valid:
Proof
Inserting semicolons in order to separate the two operations is not allowed: neither in their definition, nor in their implementation.
In contrast, if you write:
then you actually must insert a semicolon or a newline to get a successful parse.