# HG changeset patch # User Adam Chlipala # Date 1404045227 14400 # Node ID a3435112b83e8a31cbf28c31de03cd9de7eeb2b7 # Parent 1d36654c2d21dc4dcd3dc79a39fc0976a050aa9b Top.max and Top.min diff -r 1d36654c2d21 -r a3435112b83e lib/ur/top.ur --- a/lib/ur/top.ur Sun Jun 29 08:31:21 2014 -0400 +++ b/lib/ur/top.ur Sun Jun 29 08:33:47 2014 -0400 @@ -405,3 +405,8 @@ "application/x-www-form-urlencoded" => postFields' (postData pb) | _ => error Tried to get POST fields, but MIME type is not "application/x-www-form-urlencoded" 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 diff -r 1d36654c2d21 -r a3435112b83e lib/ur/top.urs --- a/lib/ur/top.urs Sun Jun 29 08:31:21 2014 -0400 +++ b/lib/ur/top.urs Sun Jun 29 08:33:47 2014 -0400 @@ -287,3 +287,6 @@ val mkRead' : t ::: Type -> (string -> option t) -> string -> read t val postFields : postBody -> list (string * string) + +val max : t ::: Type -> ord t -> t -> t -> t +val min : t ::: Type -> ord t -> t -> t -> t