# HG changeset patch # User Gabriel Riba Faura # Date 1433336866 -7200 # Node ID 4cd36865e0b59cbbfa9bfd30144e121a39af4df2 # Parent 763ccca119bc00e81a615d043429d83b7ef6118b assert function to use with location literal _LOC_ diff -r 763ccca119bc -r 4cd36865e0b5 lib/ur/top.ur --- a/lib/ur/top.ur Wed Jun 03 08:34:23 2015 +0200 +++ b/lib/ur/top.ur Wed Jun 03 15:07:46 2015 +0200 @@ -410,3 +410,6 @@ 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 {[msg]} at {[loc]}