SlideShare a Scribd company logo
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
 
C basics
C   basicsC   basics
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
MOHAMAD NOH AHMAD
 
Tokens_C
Tokens_CTokens_C
Tokens_C
Prabhu Govind
 
C Language
C LanguageC Language
C Language
Aakash Singh
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
Aniket Patne
 
C programming basics
C  programming basicsC  programming basics
C programming basics
argusacademy
 
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
jatin 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++ ppt
MalarMohana
 
C notes for exam preparation
C notes for exam preparationC notes for exam preparation
C notes for exam preparation
Lakshmi Sarvani Videla
 
Features of c language 1
Features of c language 1Features of c language 1
Features of c language 1
srmohan06
 
Features of c
Features of cFeatures of c
Features of c
Hitesh Kumar
 
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
Sinbad Konick
 
C language introduction
C language introduction C language introduction
C language introduction
musrath mohammad
 
C programming language
C programming languageC programming language
C programming language
Maha 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 ppt
Art Scott
 
F# Tutorial @ QCon
F# Tutorial @ QConF# Tutorial @ QCon
F# Tutorial @ QCon
Tomas Petricek
 
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
 
Sudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdfSudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdf
sudipto801
 
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
 
week1.ppt
week1.pptweek1.ppt
week1.ppt
nazimsattar
 
Practical F#
Practical F#Practical F#
Practical F#
Ryan Riley
 
Programming.language
Programming.languageProgramming.language
Programming.language
PRABHAKAR SHEKHAR
 
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
Skills 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 & Databases
Mubashir Ali
 
vbaintro.pdf
vbaintro.pdfvbaintro.pdf
vbaintro.pdf
ayshaukat05
 
C# handout.docx
C# handout.docxC# handout.docx
C# handout.docx
LenchoMamudeBaro
 
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 Language
Teddy Marcus
 
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional WayDomain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Tomas 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 App
Jonas 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 applikasjon
Jonas Follesø
 
Why learn new programming languages
Why learn new programming languagesWhy learn new programming languages
Why learn new programming languages
Jonas Follesø
 
Smidig 2011 TDD Workshop
Smidig 2011 TDD WorkshopSmidig 2011 TDD Workshop
Smidig 2011 TDD Workshop
Jonas Follesø
 
Cross platform mobile apps using .NET
Cross platform mobile apps using .NETCross platform mobile apps using .NET
Cross platform mobile apps using .NET
Jonas 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 platform
Jonas 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 2010
Jonas 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 7
Jonas Follesø
 
Generating characterization tests for legacy code
Generating characterization tests for legacy codeGenerating characterization tests for legacy code
Generating characterization tests for legacy code
Jonas 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 - NDC2010
Jonas 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 NDC2009
Jonas 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 2008
Jonas 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

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 

Recently uploaded (20)

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 

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!