summaryrefslogtreecommitdiff
path: root/lib/ur/top.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2014-06-29 08:33:47 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2014-06-29 08:33:47 -0400
commit26fde08de43211e6b4e8e6c1f02173629232b0ac (patch)
tree218238598a48fdb5d119334cb56573363d27ea46 /lib/ur/top.ur
parentabb214d29dd8088b5dad7b61aefb7db24fa787ac (diff)
Top.max and Top.min
Diffstat (limited to 'lib/ur/top.ur')
-rw-r--r--lib/ur/top.ur5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ur/top.ur b/lib/ur/top.ur
index 5b9d43ab..3250a5a3 100644
--- a/lib/ur/top.ur
+++ b/lib/ur/top.ur
@@ -405,3 +405,8 @@ fun postFields pb =
"application/x-www-form-urlencoded" => postFields' (postData pb)
| _ => error <xml>Tried to get POST fields, but MIME type is not "application/x-www-form-urlencoded"</xml>
end
+
+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