Consider, I have a this code.
let firstDigitIsBigerOrEqual (dig1: int) (dig2:int)= dig1>=dig2
let rec computeNumber( numbersInCharacterList:List<int>)=function
| [] -> 0
| [single] -> single
| firstDigit::secondDigit::tail when firstDigitIsBigerOrEqual firstDigit secondDigit -> firstDigit + secondDigit+ computeNumber tail
| firstDigit::secondDigit::tail when not (firstDigitIsBigerOrEqual firstDigit secondDigit) -> secondDigit - firstDigit + computeNumber tail
I have an error in the 2 last lines:
The type 'int list -> int' does not match the type 'int'
I need to get an int
as my output of y function.
What is wrong with my code?
numbersInCharacterList
. - ildjarn