learn-ocaml
learn-ocaml copied to clipboard
Feature: enable typechecking exercise templates
The exercise templates I create are always intended to be well-typed, with NotImplemented exceptions raised wherever the student is expected to provide their own solution. Sometimes these templates contain significant starter code. To verify it's well-typed, I have to build the exercise, run the server, open the exercise, and hit compile. It would be nice if I could get feedback in the build step.
This looks like a sensible suggestion, thanks.
but I'm pretty sure not all people would like to typecheck the template.ml files as well.
what about a CLI option (disabled by default) that also typechecks this file for all exercises, and triggers a global failure in case of any syntax/type error?
BTW you might be interested in the learn-ocaml-editor webapp (statically deployed at https://pfitaxel.github.io/pfitaxel-demo/#activity%3Deditor ; soon to be integrated in learn-ocaml:master so that any Test_lib improvement is taken into account):
In particular, there is a Check button in the Template tab:
Screenshot

And there's also an import/export feature of an exercise (as a .zip file)
Would it work to run something like ocamlc -i prelude.ml prepare.ml template.ml from the exercise directory ?