Skip to content

Instantly share code, notes, and snippets.

Created Jan 11, 2013
What would you like to do?
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