SlideShare a Scribd company logo
1 of 42
FUNCTIONAL
PROGRAMMING IN F#

      An introduction




  Functional Programming Day
          Jonas Follesø
           17/12/2012
ABOUT ME




           Jonas Follesø
           Scientist & Manager BEKK
           Trondheim
           github.com/follesoe
           twitter.com/follesoe
           jonas.folesoe.no
AGENDA


         Part 1 – F# & it’s history
         Part 2 – F# Fundamentals
         Part 3 – Units of Measure
         Part 4 – Type Providers
         Part 5 – Async Workflows
         Part 6 – Summary & Resources
2006:
   IT2105 -
 Functional
Programming
Scheme
Func<int, bool> isEven = n => n%2 == 0;
Action<int> print = n => Console.WriteLine("The number is {0}", n);

var numbers = new List<int> {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

numbers.Where(isEven)
       .ToList()
       .ForEach(print);


                                                               C#
Disclaimer:
F# beginner
Part 1
What is F#?
WHAT IS F#?




  … a statically typed, functional first, hybrid, open source,
              programming language for the CLR…
IN MICROSOFT OWN WORDS…




    … a productive, supported, interoperable, functional
   language that allows you to write simple code to solve
                    complex problems.
QUICK SHOW OF HANDS…




               JVM?    CLR?
IT HAS BEEN SAID…




          …F# is to C# what Scala is to Java...
HISTORY

                   • Designed and implemented by Don Syme at
                     Microsoft Research



                   • Wanted a functional programming language
                     on the CLR for research and scientific
                     computing


Photo: John Lamb
F# LANGUAGE INFLUENCES




        OCaml
                         F#     C#/.NET


 Similar core language        Similar object model
HISTORY




 Pre 2005      2005      2010                      2012
   F# 0.9       F# 1.0   F# 2.0                   F# 3.0
  Microsoft    VS2005    VS2010                   VS2012
  Research    Download   Built-in                 Built-in


                                 04. November 2010
                               F# compiler and libraries
                          released under Apache 2.0 license
Demo: F#
Fundamentals
Part 2:
Units of
Measure
MARS CLIMATE ORBITER
MARS CLIMATE ORBITER




The 'root cause' of the loss of the spacecraft was the failed
translation of English units into metric units in a segment of
ground-based, navigation-related mission software


http://mars.jpl.nasa.gov/msp98/news/mco991110.html
Demo:
Units of
Measure
Part 3
  Type
Providers
THE CHALLENGE




1. The world is information rich

2. Our programming languages are information sparse
IMPEDANCE MISS MATCH

• Rich information spaces with structured data



                                                       Open APIs
           Web
                            OData          Databases    and data
          Services
                                                        markeds




          XML             Semantic
                                           CRM data    Others…
        Documents           Web
IMPEDANCE MISS MATCH

• Need bridging mechanisms to access structured data in our programs



  • Hand-written static libraries

  • Generated static libraries

  • Dynamically-typed information representation
F# 3.0 TYPE PROVIDERS

A Type Provider is…
                                                  Statement
                                               completion for data
A design-time component that provides a
computed space of types and methods
                                                 Extensible and
                                                     open

A compiler/IDE extension
                                                 Breaking down
                                                     walls!
The static counterpart to dynamic languages:
Compile-time meta programming
Demo:
  Type
Providers
Part 5
 Async
Workflows
Part 6
Summary &
 Resources
Why?
POSSIBLE REASONS – MY OWN SPECULATIONS




             C# is too                    Microsoft
              good?                      positioning?
IS C# TOO GOOD?



• Implicitly Typed Local Variables

• Extension Methods

• Lambda Expressions and Higher Order Functions

• LINQ

• Task Parallel Library

• Extension Methods

• New asynchronous language constructs (async & await)
MICROSOFT POSITIONING


                                                C#, VB,
        F# 3.0                 F# 2.0          HTML5, JS



                        Transformation,
     Access
                           Analysis,      Presentation,
      Data,
                          Algorithms,     Publication,
  Information,
                             Code,         Experience
    Services
                            Parallel
Learning
Resources
HTTP://WWW.TRYFSHARP.ORG/
HTTP://FSHARPFORFUNANDPROFIT.COM/
FILE – NEW – F# TUTORIAL
BOOKS




Programming F# 3.0   Expert F# 3.0
by Chris Smith       by Don Syme, Adam Granicz
                     and Antonio Cisternino
THANK YOU!

     Jonas Follesø
http://jonas.follesoe.no
       @follesoe

More Related Content

What's hot

Functional Programming in C# and F#
Functional Programming in C# and F#Functional Programming in C# and F#
Functional Programming in C# and F#Alfonso Garcia-Caro
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C ProgrammingMOHAMAD NOH AHMAD
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C ProgrammingAniket Patne
 
C programming basics
C  programming basicsC  programming basics
C programming basicsargusacademy
 
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREC & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREjatin batra
 
Brief introduction to the c programming language
Brief introduction to the c programming languageBrief introduction to the c programming language
Brief introduction to the c programming languageKumar Gaurav
 
Introduction to programming with c,
Introduction to programming with c,Introduction to programming with c,
Introduction to programming with c,Hossain Md Shakhawat
 
Programming in c++ ppt
Programming in c++ pptProgramming in c++ ppt
Programming in c++ pptMalarMohana
 
Features of c language 1
Features of c language 1Features of c language 1
Features of c language 1srmohan06
 
Why C is Called Structured Programming Language
Why C is Called Structured Programming LanguageWhy C is Called Structured Programming Language
Why C is Called Structured Programming LanguageSinbad Konick
 
C programming language
C programming languageC programming language
C programming languageMaha lakshmi
 

What's hot (20)

Functional Programming in C# and F#
Functional Programming in C# and F#Functional Programming in C# and F#
Functional Programming in C# and F#
 
C basics
C   basicsC   basics
C basics
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Tokens_C
Tokens_CTokens_C
Tokens_C
 
C PROGRAMMING
C PROGRAMMINGC PROGRAMMING
C PROGRAMMING
 
C Language
C LanguageC Language
C Language
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
C programming basics
C  programming basicsC  programming basics
C programming basics
 
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTREC & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
C & C++ Training Centre in Ambala! BATRA COMPUTER CENTRE
 
Brief introduction to the c programming language
Brief introduction to the c programming languageBrief introduction to the c programming language
Brief introduction to the c programming language
 
C languaGE UNIT-1
C languaGE UNIT-1C languaGE UNIT-1
C languaGE UNIT-1
 
Introduction to programming with c,
Introduction to programming with c,Introduction to programming with c,
Introduction to programming with c,
 
Programming in c++ ppt
Programming in c++ pptProgramming in c++ ppt
Programming in c++ ppt
 
C notes for exam preparation
C notes for exam preparationC notes for exam preparation
C notes for exam preparation
 
Features of c language 1
Features of c language 1Features of c language 1
Features of c language 1
 
Features of c
Features of cFeatures of c
Features of c
 
C vs c++
C vs c++C vs c++
C vs c++
 
Why C is Called Structured Programming Language
Why C is Called Structured Programming LanguageWhy C is Called Structured Programming Language
Why C is Called Structured Programming Language
 
C language introduction
C language introduction C language introduction
C language introduction
 
C programming language
C programming languageC programming language
C programming language
 

Similar to Introduction to F#

Bay NET Aug 19 2009 presentation ppt
Bay  NET Aug 19 2009 presentation pptBay  NET Aug 19 2009 presentation ppt
Bay NET Aug 19 2009 presentation pptArt Scott
 
Sudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdfSudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdfSudipta Mukherjee
 
Sudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdfSudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdfsudipto801
 
Build your own Language - Why and How?
Build your own Language - Why and How?Build your own Language - Why and How?
Build your own Language - Why and How?Markus Voelter
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldSkills Matter
 
A Research Study of Data Collection and Analysis of Semantics of Programming ...
A Research Study of Data Collection and Analysis of Semantics of Programming ...A Research Study of Data Collection and Analysis of Semantics of Programming ...
A Research Study of Data Collection and Analysis of Semantics of Programming ...IRJET Journal
 
Lecture-4: Introduction to Programming & Databases
Lecture-4: Introduction to Programming & DatabasesLecture-4: Introduction to Programming & Databases
Lecture-4: Introduction to Programming & DatabasesMubashir Ali
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Skills Matter
 
Trend of Visual Programming Language
Trend of Visual Programming LanguageTrend of Visual Programming Language
Trend of Visual Programming LanguageTeddy Marcus
 
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional WayDomain Specific Languages: The Functional Way
Domain Specific Languages: The Functional WayTomas Petricek
 
Doc 2011101410543721
Doc 2011101410543721Doc 2011101410543721
Doc 2011101410543721Rhythm Sun
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Dastan Kamaran
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Dastan Kamaran
 

Similar to Introduction to F# (20)

Bay NET Aug 19 2009 presentation ppt
Bay  NET Aug 19 2009 presentation pptBay  NET Aug 19 2009 presentation ppt
Bay NET Aug 19 2009 presentation ppt
 
F# Tutorial @ QCon
F# Tutorial @ QConF# Tutorial @ QCon
F# Tutorial @ QCon
 
Sudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdfSudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdf
 
Sudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdfSudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdf
 
Build your own Language - Why and How?
Build your own Language - Why and How?Build your own Language - Why and How?
Build your own Language - Why and How?
 
week1.ppt
week1.pptweek1.ppt
week1.ppt
 
Practical F#
Practical F#Practical F#
Practical F#
 
Programming.language
Programming.languageProgramming.language
Programming.language
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source world
 
A Research Study of Data Collection and Analysis of Semantics of Programming ...
A Research Study of Data Collection and Analysis of Semantics of Programming ...A Research Study of Data Collection and Analysis of Semantics of Programming ...
A Research Study of Data Collection and Analysis of Semantics of Programming ...
 
Lecture-4: Introduction to Programming & Databases
Lecture-4: Introduction to Programming & DatabasesLecture-4: Introduction to Programming & Databases
Lecture-4: Introduction to Programming & Databases
 
vbaintro.pdf
vbaintro.pdfvbaintro.pdf
vbaintro.pdf
 
Intro1
Intro1Intro1
Intro1
 
C# handout.docx
C# handout.docxC# handout.docx
C# handout.docx
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#
 
Trend of Visual Programming Language
Trend of Visual Programming LanguageTrend of Visual Programming Language
Trend of Visual Programming Language
 
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional WayDomain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
 
Doc 2011101410543721
Doc 2011101410543721Doc 2011101410543721
Doc 2011101410543721
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
 
Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)Oop lecture1-chapter1(review of java)
Oop lecture1-chapter1(review of java)
 

More from Jonas Follesø

Hvordan lage en vellykket Windows Phone 7 App
Hvordan lage en vellykket Windows Phone 7 AppHvordan lage en vellykket Windows Phone 7 App
Hvordan lage en vellykket Windows Phone 7 AppJonas Follesø
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouchJonas Follesø
 
Hvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjonHvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjonJonas Follesø
 
Why learn new programming languages
Why learn new programming languagesWhy learn new programming languages
Why learn new programming languagesJonas Follesø
 
Smidig 2011 TDD Workshop
Smidig 2011 TDD WorkshopSmidig 2011 TDD Workshop
Smidig 2011 TDD WorkshopJonas Follesø
 
Cross platform mobile apps using .NET
Cross platform mobile apps using .NETCross platform mobile apps using .NET
Cross platform mobile apps using .NETJonas Follesø
 
An overview of the Windows Phone 7 platform
An overview of the Windows Phone 7 platformAn overview of the Windows Phone 7 platform
An overview of the Windows Phone 7 platformJonas Follesø
 
Windows Phone 7 lyntale fra Grensesnittet Desember 2010
Windows Phone 7 lyntale fra Grensesnittet Desember 2010Windows Phone 7 lyntale fra Grensesnittet Desember 2010
Windows Phone 7 lyntale fra Grensesnittet Desember 2010Jonas Follesø
 
NNUG Trondheim 30.09.2010 - Windows Phone 7
NNUG Trondheim 30.09.2010 -  Windows Phone 7NNUG Trondheim 30.09.2010 -  Windows Phone 7
NNUG Trondheim 30.09.2010 - Windows Phone 7Jonas Follesø
 
Generating characterization tests for legacy code
Generating characterization tests for legacy codeGenerating characterization tests for legacy code
Generating characterization tests for legacy codeJonas Follesø
 
Get a flying start with Windows Phone 7 - NDC2010
Get a flying start with Windows Phone 7 - NDC2010Get a flying start with Windows Phone 7 - NDC2010
Get a flying start with Windows Phone 7 - NDC2010Jonas Follesø
 
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)Jonas Follesø
 
MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009Jonas Follesø
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Jonas Follesø
 

More from Jonas Follesø (14)

Hvordan lage en vellykket Windows Phone 7 App
Hvordan lage en vellykket Windows Phone 7 AppHvordan lage en vellykket Windows Phone 7 App
Hvordan lage en vellykket Windows Phone 7 App
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouch
 
Hvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjonHvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjon
 
Why learn new programming languages
Why learn new programming languagesWhy learn new programming languages
Why learn new programming languages
 
Smidig 2011 TDD Workshop
Smidig 2011 TDD WorkshopSmidig 2011 TDD Workshop
Smidig 2011 TDD Workshop
 
Cross platform mobile apps using .NET
Cross platform mobile apps using .NETCross platform mobile apps using .NET
Cross platform mobile apps using .NET
 
An overview of the Windows Phone 7 platform
An overview of the Windows Phone 7 platformAn overview of the Windows Phone 7 platform
An overview of the Windows Phone 7 platform
 
Windows Phone 7 lyntale fra Grensesnittet Desember 2010
Windows Phone 7 lyntale fra Grensesnittet Desember 2010Windows Phone 7 lyntale fra Grensesnittet Desember 2010
Windows Phone 7 lyntale fra Grensesnittet Desember 2010
 
NNUG Trondheim 30.09.2010 - Windows Phone 7
NNUG Trondheim 30.09.2010 -  Windows Phone 7NNUG Trondheim 30.09.2010 -  Windows Phone 7
NNUG Trondheim 30.09.2010 - Windows Phone 7
 
Generating characterization tests for legacy code
Generating characterization tests for legacy codeGenerating characterization tests for legacy code
Generating characterization tests for legacy code
 
Get a flying start with Windows Phone 7 - NDC2010
Get a flying start with Windows Phone 7 - NDC2010Get a flying start with Windows Phone 7 - NDC2010
Get a flying start with Windows Phone 7 - NDC2010
 
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
 
MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
 

Recently uploaded

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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 interpreternaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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 productivityPrincipled Technologies
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Recently uploaded (20)

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Introduction to F#

  • 1. FUNCTIONAL PROGRAMMING IN F# An introduction Functional Programming Day Jonas Follesø 17/12/2012
  • 2. ABOUT ME Jonas Follesø Scientist & Manager BEKK Trondheim github.com/follesoe twitter.com/follesoe jonas.folesoe.no
  • 3. AGENDA Part 1 – F# & it’s history Part 2 – F# Fundamentals Part 3 – Units of Measure Part 4 – Type Providers Part 5 – Async Workflows Part 6 – Summary & Resources
  • 4. 2006: IT2105 - Functional Programming
  • 6.
  • 7. Func<int, bool> isEven = n => n%2 == 0; Action<int> print = n => Console.WriteLine("The number is {0}", n); var numbers = new List<int> {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; numbers.Where(isEven) .ToList() .ForEach(print); C#
  • 10. WHAT IS F#? … a statically typed, functional first, hybrid, open source, programming language for the CLR…
  • 11. IN MICROSOFT OWN WORDS… … a productive, supported, interoperable, functional language that allows you to write simple code to solve complex problems.
  • 12. QUICK SHOW OF HANDS… JVM? CLR?
  • 13. IT HAS BEEN SAID… …F# is to C# what Scala is to Java...
  • 14. HISTORY • Designed and implemented by Don Syme at Microsoft Research • Wanted a functional programming language on the CLR for research and scientific computing Photo: John Lamb
  • 15. F# LANGUAGE INFLUENCES OCaml F# C#/.NET Similar core language Similar object model
  • 16. HISTORY Pre 2005 2005 2010 2012 F# 0.9 F# 1.0 F# 2.0 F# 3.0 Microsoft VS2005 VS2010 VS2012 Research Download Built-in Built-in 04. November 2010 F# compiler and libraries released under Apache 2.0 license
  • 17.
  • 18.
  • 19.
  • 23. MARS CLIMATE ORBITER The 'root cause' of the loss of the spacecraft was the failed translation of English units into metric units in a segment of ground-based, navigation-related mission software http://mars.jpl.nasa.gov/msp98/news/mco991110.html
  • 25. Part 3 Type Providers
  • 26. THE CHALLENGE 1. The world is information rich 2. Our programming languages are information sparse
  • 27. IMPEDANCE MISS MATCH • Rich information spaces with structured data Open APIs Web OData Databases and data Services markeds XML Semantic CRM data Others… Documents Web
  • 28. IMPEDANCE MISS MATCH • Need bridging mechanisms to access structured data in our programs • Hand-written static libraries • Generated static libraries • Dynamically-typed information representation
  • 29. F# 3.0 TYPE PROVIDERS A Type Provider is… Statement completion for data A design-time component that provides a computed space of types and methods Extensible and open A compiler/IDE extension Breaking down walls! The static counterpart to dynamic languages: Compile-time meta programming
  • 32. Part 6 Summary & Resources
  • 33. Why?
  • 34. POSSIBLE REASONS – MY OWN SPECULATIONS C# is too Microsoft good? positioning?
  • 35. IS C# TOO GOOD? • Implicitly Typed Local Variables • Extension Methods • Lambda Expressions and Higher Order Functions • LINQ • Task Parallel Library • Extension Methods • New asynchronous language constructs (async & await)
  • 36. MICROSOFT POSITIONING C#, VB, F# 3.0 F# 2.0 HTML5, JS Transformation, Access Analysis, Presentation, Data, Algorithms, Publication, Information, Code, Experience Services Parallel
  • 40. FILE – NEW – F# TUTORIAL
  • 41. BOOKS Programming F# 3.0 Expert F# 3.0 by Chris Smith by Don Syme, Adam Granicz and Antonio Cisternino
  • 42. THANK YOU! Jonas Follesø http://jonas.follesoe.no @follesoe

Editor's Notes

  1. 1973, Robin Milner at the University of Edinburgh developed the ML programming language to develop proof tactics for the LCF Theorem prover. Lisp continued to be used for years as the favored language of AI researchers.ML stands out among other functional programming languages; its polymorphic functions made it a very expressive language, while its strong typing and immutable data structures made it possible to compile ML into very efficient machine code.L&apos;s relative success spawned an entire family of ML-derived languages, including Standard ML, Caml, and its most famous dialect called OCaml which unifies functional programming with object-oriented and imperative styles.F# is essentially a .Net implementation of OCaml, combining the power and expressive syntax of functional programming with the tens of thousands of classes which make up the .NET class library.
  2. Mars Climate Orbiter ble skutt opp 11. desember 1998. Oppdraget var å studere været, klimaet, og vann- og karbondioksidinnhold på planeten Mars. Den 23. september 1999 skulle farkosten gå inn i bane rundt Mars, men en beregningsfeil resulterte i at Mars Climate Orbiter gikk inn 90 km for lavt. Dette førte til for store påkjenninger og friksjon fra Mars atmosfære, og fartøyet gikk i oppløsning.
  3. NASAs undersøkelser etter ulykken avdekket at feilen skyltes en software-feil, hvor to delsystemer brukte forskjellig sett med måleenheter. Det ene systemet brukte imperiske enheter (pound-seconds, lbf*s) istedenfor metriske enheter (newton-seconds, N·s) som spesifisert av NASA.
  4. Mars 2012: Microsoft&apos;s F# continues to evolve, with the recent release of F# 3.0 beta. F# is excellent at concisely expressing business and domain logic. Developers trying to achieve explicit business logic within an application may opt to express their domain in F# with the majority of plumbing code in C#.
  5. Takk for oss.Ha en heltfantastiskfagdag!