Created
July 1, 2024 12:41
-
-
Save espio999/d942b3a12ff7e1fb892e07c37115759c to your computer and use it in GitHub Desktop.
F# pattern matching - type annotation
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 detect1 x = | |
match x with | |
| 1 -> printfn "Found a 1!" | |
| (var1 : int) -> printfn "%d" var1 | |
let my_list = [0..9] | |
for i in my_list do detect1 i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment