Companion code for paper "Imperative Functional Programs that Explain their Work", Wilmer Ricciotti, Jan Stolarek, Roly Perera and James Cheney, ICFP 2017, Oxford, UK
let abs = fun abs (x : int) : int => if x > 0 then x else (0 - x) in
The problem is that it shouldn't. Notice the in at the end of line - these kind of let bindings are not allowed in REPL and should be a parse error. Even more strangely deleting the in also works, which means both forms of let-bindings are accepted. This is a nice feature, but according to my understanding of the source code this should not work this way. I want to understand why it does work.
Loading this single-line file into REPL works:
The problem is that it shouldn't. Notice the
in
at the end of line - these kind of let bindings are not allowed in REPL and should be a parse error. Even more strangely deleting thein
also works, which means both forms of let-bindings are accepted. This is a nice feature, but according to my understanding of the source code this should not work this way. I want to understand why it does work.