summaryrefslogtreecommitdiff
path: root/lib/ur/top.ur
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2015-08-19 11:02:23 -0400
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2015-08-19 11:02:23 -0400
commit598756dc69f89cf2dd2b889cad63a7a690ae7ed7 (patch)
tree5fc521225e717163c30ea494a5839c26725eec2e /lib/ur/top.ur
parent7ea9d17bad72cf2829c75d8d241fafa70b2c9b94 (diff)
parentfb6e6599b35df9cfa05786772868b1a3d2e58ac3 (diff)
Merge branch 'upstream' into dfsg_clean20150819+dfsg
Conflicts: doc/intro.ur
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>