summaryrefslogtreecommitdiff
path: root/lib/ur/top.ur
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ur/top.ur')
-rw-r--r--lib/ur/top.ur3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ur/top.ur b/lib/ur/top.ur
index 3250a5a3..e831b4f7 100644
--- a/lib/ur/top.ur
+++ b/lib/ur/top.ur
@@ -410,3 +410,6 @@ fun max [t] ( _ : ord t) (x : t) (y : t) : t =
if x > y then x else y
fun min [t] ( _ : ord t) (x : t) (y : t) : t =
if x < y then x else y
+
+fun assert [a] (cond: bool) (msg: string) (loc: string) (x:a): a =
+ if cond then x else error <xml>{txt msg} at {txt loc}</xml>