Use function keyword

Category:
Defining Operator
Description: Use function keyword
Code:
type Patterns = 
| Pattern0
| Pattern1

let DefineFunction2() =
let p = Patterns.Pattern0
let matchResult = function
| Pattern0 -> "pattern0"
| Pattern1 -> "pattern1"
printfn "%A" (matchResult p)

Execution Result:
"pattern0"

Last edited Sep 14, 2011 at 2:39 AM by ttliu2000, version 1

Comments

No comments yet.