Int Option instead of Int in F#
问题 I am having trouble with the following: let safeDiv x y = match (x,y) with | (_, Some 0) -> None | (Some xx, Some yy) -> Some (xx/yy) | _ -> None When I go to run this simple function in the interactive window of Visual Studio like so: safeDiv 4 2 I get the following error... This expression was expected to have type int option but here has type int. Could it be I'm meant to use safeDiv Some(4) Some(2) ? This doesn't work either... 回答1: Ok, this is overkill but I actually did something