Skip to content

Instantly share code, notes, and snippets.

@adilakhter

adilakhter/bound.fs

Created Jan 11, 2013
Embed
What would you like to do?
bound
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
You can’t perform that action at this time.