Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save espio999/d942b3a12ff7e1fb892e07c37115759c to your computer and use it in GitHub Desktop.
Save espio999/d942b3a12ff7e1fb892e07c37115759c to your computer and use it in GitHub Desktop.
F# pattern matching - type annotation
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