The original Effekt paper uses the effect keyword for both an "interface" and a singleton operation:
effect Lexer {
def peek(): Option[Token]
def next(): Token
}
effect Emit {
def text(content: String): Unit
def newline(): Unit
}
effect LayoutChoice {
def fail[A](): A
def choice(): Direction
}
effect Next(): String
effect Choice(): Boolean
However, when you read the paper and just want to try things out on the website, you get a bizarre parser error:
I think it would be nice to special case this exact syntax in the parser to provide a much nicer error message: something that underlines the effect keyword, says "Did you mean interface? ...", and ideally provides a quick-fix that works both in VSCode and on the website.
The original Effekt paper uses the
effect
keyword for both an "interface" and a singleton operation:However, when you read the paper and just want to try things out on the website, you get a bizarre parser error:
I think it would be nice to special case this exact syntax in the parser to provide a much nicer error message: something that underlines the
effect
keyword, says "Did you meaninterface
? ...", and ideally provides a quick-fix that works both in VSCode and on the website.Relevant code
https://github.com/effekt-lang/effekt/blob/6e71bcd59bf419f2ba5923d9eca519b87d3804b5/effekt/shared/src/main/scala/effekt/RecursiveDescent.scala#L469-L486