عنوان:

‫دلایل استفاده از #F


نویسنده: سید علیرضا حسینی
تاریخ: ۱۳۹۵/۰۹/۱۲ ۲۳:۲۳
آدرس: www.dntips.ir

 Convenience :

// automatic equality and comparison
type Person = {First:string; Last:string}
let person1 = {First="john"; Last="Doe"}
let person2 = {First="john"; Last="Doe"}
printfn "Equal? %A"  (person1 = person2)

// easy IDisposable logic with "use" keyword
use reader = new StreamReader(..)

// easy composition of functions
let add2times3 = (+) 2 >> (*) 3
let result = add2times3 5



مشاهده مطلب اصلی