summaryrefslogtreecommitdiff
path: root/src/nbc/fail.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/nbc/fail.sml')
-rw-r--r--src/nbc/fail.sml10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nbc/fail.sml b/src/nbc/fail.sml
new file mode 100644
index 0000000..f3d324c
--- /dev/null
+++ b/src/nbc/fail.sml
@@ -0,0 +1,10 @@
+signature FAIL = sig
+ val fail: string -> 'a
+end
+
+structure Fail :> FAIL = struct
+ fun fail why = (
+ TextIO.output (TextIO.stdErr, why ^ "\n")
+ ; OS.Process.exit OS.Process.failure
+ )
+end