SlideShare ist ein Scribd-Unternehmen logo
1 von 31
www.dotnet.lv
Valdis Iljuconoks
Technical Fellow, Software Architect
Microsoft MVP

        Geta AS, Viiar Consulting
        valdis.iljuconoks@dotnet.lv
        http://dotnet.lv/blogs/vi
        @tech_fellow
F#
what is it?
x = x + 1
functional
   First official

programming language on .Net
why?
do more with less
see where C# and VB.NET are headed
   learn new language every year
functional
object-oriented
  imperative
Theorem proving ISWIM   (1966)


          ML
         CAML
        OCAML
          F#
‘let’ binding
let a = 2
// F#           // C#
let a = 2   ≠   int a = 2
// F#       // C#
let a = 2   static int a()
            {
              return 2;
            }
let a = 2
let a = 3


error: FS0037 Duplicate definition of value ‘a’




            Immutable by default
Strong
Static

 Weak
Dynamic
functions
let sqr x = x * x

> val sqr parameter int
           : int ->

sqr 5                signature
                      data type
> val it: int = 25

                     result
demo

sum of sqr of t
high order functions




            A higher-order function is a function

that takesanother function                   as a parameter,
   or a function that returns another function as a value,
               or a function which does both.
let sqr x : float = x * x
let mply a b : float = a * b


let mplyPI a = mply a 3.14159


let cylinderVolume radius length =
   mplyPI length * sqr radius
demo

function pipelining (|>)
demo

function composition (>>)
discriminated unions
type NullableInt =
     | Value of int
     | Nothing of unit


match x with
  | Value -> ...
  | Nothing -> ...
interoperability
demo

.Net interoperability
functional
   First official

programming language on .Net
?
Valdis Iljuconoks
Technical Fellow, Software Architect
Microsoft MVP

        Geta AS, Viiar Consulting
        valdis.iljuconoks@dotnet.lv
        http://dotnet.lv/blogs/vi
        @tech_fellow
www.dotnet.lv

Weitere ähnliche Inhalte

Was ist angesagt?

Constructor and Destructor
Constructor and DestructorConstructor and Destructor
Constructor and Destructor
Kamal Acharya
 
Introduction To Algorithm [2]
Introduction To Algorithm [2]Introduction To Algorithm [2]
Introduction To Algorithm [2]
ecko_disasterz
 
Objective c
Objective cObjective c
Objective c
Stijn
 
Reasoning about laziness
Reasoning about lazinessReasoning about laziness
Reasoning about laziness
Johan Tibell
 

Was ist angesagt? (20)

Web futures
Web futuresWeb futures
Web futures
 
Matlab Nn Intro
Matlab Nn IntroMatlab Nn Intro
Matlab Nn Intro
 
Migrating Objective-C to Swift
Migrating Objective-C to SwiftMigrating Objective-C to Swift
Migrating Objective-C to Swift
 
if, while and for in Python
if, while and for in Pythonif, while and for in Python
if, while and for in Python
 
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)Value Objects, Full Throttle (to be updated for spring TC39 meetings)
Value Objects, Full Throttle (to be updated for spring TC39 meetings)
 
Analisa Expression pada after effect menggungakan bahasa script
Analisa  Expression pada after effect menggungakan bahasa scriptAnalisa  Expression pada after effect menggungakan bahasa script
Analisa Expression pada after effect menggungakan bahasa script
 
Constructor and destructor
Constructor  and  destructor Constructor  and  destructor
Constructor and destructor
 
Constructor and Destructor
Constructor and DestructorConstructor and Destructor
Constructor and Destructor
 
Migration Objective-C to Swift
Migration Objective-C to SwiftMigration Objective-C to Swift
Migration Objective-C to Swift
 
Introduction To Algorithm [2]
Introduction To Algorithm [2]Introduction To Algorithm [2]
Introduction To Algorithm [2]
 
Objective c
Objective cObjective c
Objective c
 
Types of Constructor in C++
Types of Constructor in C++Types of Constructor in C++
Types of Constructor in C++
 
Reasoning about laziness
Reasoning about lazinessReasoning about laziness
Reasoning about laziness
 
Aaa ped-10-Supervised Learning: Introduction to Supervised Learning
Aaa ped-10-Supervised Learning: Introduction to Supervised LearningAaa ped-10-Supervised Learning: Introduction to Supervised Learning
Aaa ped-10-Supervised Learning: Introduction to Supervised Learning
 
functions in C
functions in Cfunctions in C
functions in C
 
Fsharp shdh 40 lightning talk
Fsharp shdh 40 lightning talkFsharp shdh 40 lightning talk
Fsharp shdh 40 lightning talk
 
constructor & destructor in cpp
constructor & destructor in cppconstructor & destructor in cpp
constructor & destructor in cpp
 
Functional programming
Functional programmingFunctional programming
Functional programming
 
C standard library functions
C standard library functionsC standard library functions
C standard library functions
 
Directed Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocksDirected Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocks
 

Andere mochten auch (8)

MAXI GIPSY LATINO MUSIC
MAXI GIPSY LATINO  MUSICMAXI GIPSY LATINO  MUSIC
MAXI GIPSY LATINO MUSIC
 
Windows phone development
Windows phone developmentWindows phone development
Windows phone development
 
Asp.Net MVC overview
Asp.Net MVC overviewAsp.Net MVC overview
Asp.Net MVC overview
 
CSharp 5 Async
CSharp 5 AsyncCSharp 5 Async
CSharp 5 Async
 
Knockoutjs UG meeting presentation
Knockoutjs UG meeting presentationKnockoutjs UG meeting presentation
Knockoutjs UG meeting presentation
 
Lap around Visual Studio 2013
Lap around Visual Studio 2013Lap around Visual Studio 2013
Lap around Visual Studio 2013
 
Parallel development in VS 2012
Parallel development in VS 2012Parallel development in VS 2012
Parallel development in VS 2012
 
HONEYMOON IN VENICE(mandolin) Mézeshetek Velencében
HONEYMOON IN VENICE(mandolin)   Mézeshetek VelencébenHONEYMOON IN VENICE(mandolin)   Mézeshetek Velencében
HONEYMOON IN VENICE(mandolin) Mézeshetek Velencében
 

Ähnlich wie Introduction to FSharp

C++11: Feel the New Language
C++11: Feel the New LanguageC++11: Feel the New Language
C++11: Feel the New Language
mspline
 
Building High-Performance Language Implementations With Low Effort
Building High-Performance Language Implementations With Low EffortBuilding High-Performance Language Implementations With Low Effort
Building High-Performance Language Implementations With Low Effort
Stefan Marr
 

Ähnlich wie Introduction to FSharp (20)

C++11: Feel the New Language
C++11: Feel the New LanguageC++11: Feel the New Language
C++11: Feel the New Language
 
Python programming- Part IV(Functions)
Python programming- Part IV(Functions)Python programming- Part IV(Functions)
Python programming- Part IV(Functions)
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented Technologies
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N years
 
17javascript.ppt
17javascript.ppt17javascript.ppt
17javascript.ppt
 
17javascript.ppt
17javascript.ppt17javascript.ppt
17javascript.ppt
 
Functions_21_22.pdf
Functions_21_22.pdfFunctions_21_22.pdf
Functions_21_22.pdf
 
Lecture2.ppt
Lecture2.pptLecture2.ppt
Lecture2.ppt
 
Functional Programming Patterns (BuildStuff '14)
Functional Programming Patterns (BuildStuff '14)Functional Programming Patterns (BuildStuff '14)
Functional Programming Patterns (BuildStuff '14)
 
Python avinash
Python avinashPython avinash
Python avinash
 
F# Presentation for SmartDevs, Hereford
F# Presentation for SmartDevs, HerefordF# Presentation for SmartDevs, Hereford
F# Presentation for SmartDevs, Hereford
 
Thinking in Functions
Thinking in FunctionsThinking in Functions
Thinking in Functions
 
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
Java/Scala Lab: Анатолий Кметюк - Scala SubScript: Алгебра для реактивного пр...
 
Functional programming with FSharp
Functional programming with FSharpFunctional programming with FSharp
Functional programming with FSharp
 
Functional Objects in Ruby: new horizons – Valentine Ostakh
Functional Objects in Ruby: new horizons  – Valentine OstakhFunctional Objects in Ruby: new horizons  – Valentine Ostakh
Functional Objects in Ruby: new horizons – Valentine Ostakh
 
Microsoft Silverlight
Microsoft SilverlightMicrosoft Silverlight
Microsoft Silverlight
 
Functions.pdf
Functions.pdfFunctions.pdf
Functions.pdf
 
Functionscs12 ppt.pdf
Functionscs12 ppt.pdfFunctionscs12 ppt.pdf
Functionscs12 ppt.pdf
 
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
 
Building High-Performance Language Implementations With Low Effort
Building High-Performance Language Implementations With Low EffortBuilding High-Performance Language Implementations With Low Effort
Building High-Performance Language Implementations With Low Effort
 

Kürzlich hochgeladen

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Introduction to FSharp

Hinweis der Redaktion

  1. ISWIM - If You see what I meanML – metalanguageCaml - Categorical Abstract Machine LanguageOCaml – Objective Caml
  2. Data types are inferred
  3. Data types are inferred
  4. Data types are inferred