Define function

Category:
Defining Operator
Description: define a function and composite functions and pipeline
Code:
let DefineFunction1() =
let f1 a = a + 1
let f2 a = a * 10
let ff = f1 >> f2
let r = ff 3
let r1 = 3 |> f1 |> f2
printfn "result = %d and result1 = %d" r r1
Assert.AreEqual(r, r1)

Execution Result:
result = 40 and result1 = 40
both elements are equal

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

Comments

No comments yet.