summaryrefslogtreecommitdiff
path: root/lib/ur/top.ur
diff options
context:
space:
mode:
authorGravatar Ziv Scully <ziv@mit.edu>2015-07-19 19:05:16 -0700
committerGravatar Ziv Scully <ziv@mit.edu>2015-07-19 19:05:16 -0700
commita197d648e075a696f5ca86b23913b668f2baf940 (patch)
tree4c044e00c2df8ca6fd76d072f05bf1e3ff202140 /lib/ur/top.ur
parentbc38beafd07b7ae6106a2fffda82084a08af7f06 (diff)
parentc6e4d352f01eff2ddcdcc53c0f2a14666c2af8b2 (diff)
Merge.
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>