F#是一種函數式編程語言,能夠輕鬆編寫正確且可維護的代碼。編程
F#編程主要涉及定義類型推斷和自動泛化的類型和函數。 這使您能夠將焦點保留在問題域上並操縱其數據,而不是編程的細節。app
open System // Gets access to functionality in System namespace. // Defines a function that takes a name and produces a greeting. let getGreeting name = sprintf "Hello, %s! Isn't F# great?" name [<EntryPoint>] let main args = // Defines a list of names let names = [ "Don"; "Julia"; "Xi" ] // Prints a greeting for each name! names |> List.map getGreeting |> List.iter (fun greeting -> printfn "%s" greeting) 0
F#有許多功能,包括:異步
// Group data with Records type SuccessfulWithdrawal = { Amount: decimal Balance: decimal } type FailedWithdrawal = { Amount: decimal Balance: decimal IsOverdraft: bool } // Use discriminated unions to represent data of 1 or more forms type WithdrawalResult = | Success of SuccessfulWithdrawal | InsufficientFunds of FailedWithdrawal | CardExpired of System.DateTime | UndisclosedFailure
F#記錄和區分聯合在默認狀況下是非null,不可變和可比較的,使它們很是容易使用。完整教程閱讀http://nopapp.com/Blog/Article/FSharp-What-Is-FSharp編程語言