Introduction to FSharp

372 views
331 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
372
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
6
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • ISWIM - If You see what I meanML – metalanguageCaml - Categorical Abstract Machine LanguageOCaml – Objective Caml
  • Data types are inferred
  • Data types are inferred
  • Data types are inferred
  • Introduction to FSharp

    1. 1. www.dotnet.lv
    2. 2. Valdis IljuconoksTechnical Fellow, Software ArchitectMicrosoft MVP Geta AS, Viiar Consulting valdis.iljuconoks@dotnet.lv http://dotnet.lv/blogs/vi @tech_fellow
    3. 3. F#
    4. 4. what is it?
    5. 5. x = x + 1
    6. 6. functional First officialprogramming language on .Net
    7. 7. why?
    8. 8. do more with lesssee where C# and VB.NET are headed learn new language every year
    9. 9. functionalobject-oriented imperative
    10. 10. Theorem proving ISWIM (1966) ML CAML OCAML F#
    11. 11. ‘let’ binding
    12. 12. let a = 2
    13. 13. // F# // C#let a = 2 ≠ int a = 2
    14. 14. // F# // C#let a = 2 static int a() { return 2; }
    15. 15. let a = 2let a = 3error: FS0037 Duplicate definition of value ‘a’ Immutable by default
    16. 16. StrongStatic WeakDynamic
    17. 17. functions
    18. 18. let sqr x = x * x> val sqr parameter int : int ->sqr 5 signature data type> val it: int = 25 result
    19. 19. demosum of sqr of t
    20. 20. high order functions A higher-order function is a functionthat takesanother function as a parameter, or a function that returns another function as a value, or a function which does both.
    21. 21. let sqr x : float = x * xlet mply a b : float = a * blet mplyPI a = mply a 3.14159let cylinderVolume radius length = mplyPI length * sqr radius
    22. 22. demofunction pipelining (|>)
    23. 23. demofunction composition (>>)
    24. 24. discriminated unions
    25. 25. type NullableInt = | Value of int | Nothing of unitmatch x with | Value -> ... | Nothing -> ...
    26. 26. interoperability
    27. 27. demo.Net interoperability
    28. 28. functional First officialprogramming language on .Net
    29. 29. ?
    30. 30. Valdis IljuconoksTechnical Fellow, Software ArchitectMicrosoft MVP Geta AS, Viiar Consulting valdis.iljuconoks@dotnet.lv http://dotnet.lv/blogs/vi @tech_fellow
    31. 31. www.dotnet.lv

    ×