Created
February 7, 2024 02:56
-
-
Save amw-zero/2956b0ef7d5ef1cdab4a34b7154e46d7 to your computer and use it in GitHub Desktop.
Passing an optional through
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g o = match o with | |
| None -> 0 | |
| Some x -> x | |
let f o = match o with | |
| None -> 0 | |
| Some x -> g o | |
let _ = f (Some 5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment