Created
January 11, 2013 14:26
-
-
Save adilakhter/4511020 to your computer and use it in GitHub Desktop.
bound
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec bound (lst:int list) : (int*int) option = | |
match lst with | |
| [] -> None // Empty List | |
| xhd::xtl -> | |
match bound xtl with | |
| None -> Some (xhd,xhd) // List with only 1 element | |
| Some (x,y) -> | |
Some ((if x>xhd then xhd else x), (if y<xhd then xhd else y)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment