Companion code for paper "Imperative Functional Programs that Explain their Work", Wilmer Ricciotti, Jan Stolarek, Roly Perera and James Cheney, ICFP 2017, Oxford, UK
Comments in REPL scripts don't parse, unless they follow a legal expression. This requires some hackery to fix. At the moment loadFileToRepl has a hack to filter out empty lines. Perhaps it would make sense to add a fix there and drop those lines that contain only comments. That feels wrong though because it means duplicating parser logic outside of parser. An alternative would be to fix the REPL parser to accept comment-only lines and empty lines as well. The tricky part is that we currently assume that a successfully parsed line contains either a data declaration or an expression. I tried to return an empty data context when parsing a comment - in theory this should work but in practice it didn't and I don't have time to investigate further now.
Comments in REPL scripts don't parse, unless they follow a legal expression. This requires some hackery to fix. At the moment
loadFileToRepl
has a hack to filter out empty lines. Perhaps it would make sense to add a fix there and drop those lines that contain only comments. That feels wrong though because it means duplicating parser logic outside of parser. An alternative would be to fix the REPL parser to accept comment-only lines and empty lines as well. The tricky part is that we currently assume that a successfully parsed line contains either a data declaration or an expression. I tried to return an empty data context when parsing a comment - in theory this should work but in practice it didn't and I don't have time to investigate further now.