I need a recursive function in F# that gives me the biggest value of a non empty list. example:
biggest [2;4;5;3;9;3]
should return 9
Update 1
I'm learning recursive functions and this is an exercise from the book with no answer on it. I thought it was ok to ask here but it seems it was not a good idea. Ok, I didn't write any code example so that it seemed to be a homework exercise of a lazy guy. Anyway this is my best try:
let rec highest l =
match l with
|[] -> 0
|x::y::xs -> if x > y then highest x::xs
else highest y::xs
But this doesn't work. I cannot use F# functions, this is for learning purpose of course. So sorry if made you loose some time and thanks for your help.