From 465fb70bdcb0acd7a13f8b06c821e9d7496e2603 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Thu, 13 Sep 2018 13:18:07 -0400 Subject: Imported tutch example --- examples/tutch/main.sml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 examples/tutch/main.sml (limited to 'examples/tutch/main.sml') diff --git a/examples/tutch/main.sml b/examples/tutch/main.sml new file mode 100644 index 0000000..95e5bb5 --- /dev/null +++ b/examples/tutch/main.sml @@ -0,0 +1,25 @@ +(* Copyright (C) 2017 Ryan Kavanagh *) +(* Distributed under the ISC license, see COPYING for details. *) + +structure Main :> + sig + val main : (string * string list) -> OS.Process.status + end += +struct +structure H = Helper (structure C = struct val handinPath = "handin" end) +structure C = ChecksHelper(structure H = H) + +fun main _ = + let val scores = H.runChecks C.checks + val scoreboard = C.scoreboard scores + (* Make sure the scores are on the last line. *) + val _ = print "\n\n\n" + (* This below *must must must* be the last thing printed.. *) + val _ = H.printLn (H.scoresToString (scores, scoreboard)) + in OS.Process.success end + handle _ => (H.abortWithMessage o H.stringsInBox) + [ "Experienced uncaught exception!" + , "If you believe this to be in error, please contact your" + ^ " course staff." ] +end -- cgit v1.2.3