SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Turning to the Functional side(Using C# and F#) Phil Trelford http://trelford.com/blog@ptrelford Tomas Petricek http://tomasp.net/blog@tomaspetricek
About Us Tomas  Author of F# book for C# programmers Worked with the F# team at Microsoft First blogged about F# in May 2006 Phil  Software Developer and Architect Worked on first F# applications at Microsoft Co-organizer of London F# User Group
Tutorial Goals Introduce Functional Concepts with F# and C# Non-goals Provide in-depth understanding Mass conversion to functional programming cult Sell books
Jargon Buster OO = Object Orientated FP = Functional Programming Lambda = Anonymous Function DSL = Domain Specific Language
Thoughtworks Technology Radar 2011
Languages circa 2010
Languages go multi-paradigm
F# is a mix of
What is F#? F# is multi-paradigm language, that is: Functional Declarative Object Orientated Imperative .Net language with VS integration
Running F# Visual Studio 2010 Visual Studio Shell + F#  MonoDevelop on Linux and Mac F# Compiler + Emacs etc. In your browser
FP hits mainstream Visual Studio gets F# C# gets LINQ, lambdas, etc C++ gets lambdas JVM gets Clojure & Scala
Writing queries with LINQ Query syntax supported in C# 3.0 Functional programming concepts Declaratively describes “what” not “how” Written as single expression varq= frompindb.Products wherep.UnitPrice>75.0M selectString.Format("{0} - ${1}",  p.ProductName, p.UnitPrice);
Graphical User Interface Frameworks XUL (Mozilla), Glade (Gtk), XAML (.NET) Functional programming concepts Compose button with ellipse inside Specify behavior declaratively <Buttonx:Name="greenBtn" Background="Black">   <EllipseWidth="75"Height="75" Fill="LightGreen" /> </Button> <DoubleAnimationStoryboard.TargetName="greenBtn" Storyboard.TargetProperty="(Canvas.Left)"     From="0.0"To="100.0"Duration="0:0:5" />
Specifying financial contracts in F# Functional programming concepts Declaratively describes “what” not “how” Written as single expression Composed from small number of primitives letmarch day = DateTime(2011, 3, day) letitTrades =   (sell (tradeAt(march15) "GOOG"500)) $   (between (march10) (march19) (trade"MSFT"1000)) lettradeAtdatewhatamount = between datedate (trade whatamount)
Code Samples 1: // Declare a local value (inferred type is string) 2: letworld="world" 3:  4: // Using '%s' format specifier to include string parameter 5: printfn"Hello %s!"world  
Functional data structures A way of thinking about problems Model data using composition of primitives Tuple    Combine two values of different types Discriminated Union    Represents one of several options List    Zero or more values of the same type
Tuples: Containers for a few different things
Discriminated Unions: Exclusive alternatives
Representing event schedule Object-oriented way Easy to add new cases Hard to add new functions Functional way Easy to add new functions Hard to add new cases Good thing about F# and Scala– you can use both!
List: Heads and Tails
Map Reduce MapReduce is a patented software framework introduced by Google to support distributed computing on large data sets on clusters of computers. Functional design scales extremely well!
Domain Modelling Retail Domain -> Testing
Checkout application workflow Think of a simple while loop Implement… Mutable field to keep the state and event handlers? Asynchronous while loop in F#
Asynchronous and concurrent programming Asynchronous GUI in Checkout example Single-threaded thanks to Async.StartImmediate Easy way to encode control flow Parallel programming Workflows are non-blocking computations Run workflows in parallel with Async.Parallel Concurrent programming Compose application from (thousands of) agents Agents communicate using messages
Wild Card Filler Silverlight mini-samples
Summary FP is already in the mainstream FP languages are ready Start small, go big Language Orientated Programming Exploratory and Scripting Asynchronous & Concurrency Technical Computing Testing
Summary Don’t underestimate  the power of the  functional side
Meet the F#ers
F# Books
On the horizon Next Meet: In the brain of  Rob Pickering on March 16th
Q & A http://Fsharp.net http://fssnip.net http://tomasp.net/blog http://trelford.com/blog

Weitere ähnliche Inhalte

Was ist angesagt?

Effective Data Analysis with Deedle
Effective Data Analysis with DeedleEffective Data Analysis with Deedle
Effective Data Analysis with DeedleHoward Mansell
 
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
 
F# for functional enthusiasts
F# for functional enthusiastsF# for functional enthusiasts
F# for functional enthusiastsJack Fox
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Skills Matter
 
Data analysis with R and Julia
Data analysis with R and JuliaData analysis with R and Julia
Data analysis with R and JuliaMark Tabladillo
 
F# Type Providers in Depth
F# Type Providers in DepthF# Type Providers in Depth
F# Type Providers in DepthTomas Petricek
 
Introduction to Rstudio
Introduction to RstudioIntroduction to Rstudio
Introduction to RstudioOlga Scrivner
 
C & C++ Training in Ambala ! BATRA COMPUTER CENTRE
C & C++ Training in Ambala ! BATRA COMPUTER CENTREC & C++ Training in Ambala ! BATRA COMPUTER CENTRE
C & C++ Training in Ambala ! BATRA COMPUTER CENTREjatin batra
 
C++ questions and answers
C++ questions and answersC++ questions and answers
C++ questions and answersDeepak Singh
 

Was ist angesagt? (20)

Effective Data Analysis with Deedle
Effective Data Analysis with DeedleEffective Data Analysis with Deedle
Effective Data Analysis with Deedle
 
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#
 
F# for functional enthusiasts
F# for functional enthusiastsF# for functional enthusiasts
F# for functional enthusiasts
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
 
Data analysis with R and Julia
Data analysis with R and JuliaData analysis with R and Julia
Data analysis with R and Julia
 
F# in MonoDevelop
F# in MonoDevelopF# in MonoDevelop
F# in MonoDevelop
 
C vs c++
C vs c++C vs c++
C vs c++
 
Have you met Julia?
Have you met Julia?Have you met Julia?
Have you met Julia?
 
F# Type Providers in Depth
F# Type Providers in DepthF# Type Providers in Depth
F# Type Providers in Depth
 
Lecture 2 lisp-Overview
Lecture 2 lisp-OverviewLecture 2 lisp-Overview
Lecture 2 lisp-Overview
 
basics of c++
basics of c++basics of c++
basics of c++
 
Introduction to Rstudio
Introduction to RstudioIntroduction to Rstudio
Introduction to Rstudio
 
Create Your Own Language
Create Your Own LanguageCreate Your Own Language
Create Your Own Language
 
Swift vs. Language X
Swift vs. Language XSwift vs. Language X
Swift vs. Language X
 
LIL Presentation
LIL PresentationLIL Presentation
LIL Presentation
 
C & C++ Training in Ambala ! BATRA COMPUTER CENTRE
C & C++ Training in Ambala ! BATRA COMPUTER CENTREC & C++ Training in Ambala ! BATRA COMPUTER CENTRE
C & C++ Training in Ambala ! BATRA COMPUTER CENTRE
 
R language
R languageR language
R language
 
Fun with java 8
Fun with java 8Fun with java 8
Fun with java 8
 
C++ questions and answers
C++ questions and answersC++ questions and answers
C++ questions and answers
 
R language
R languageR language
R language
 

Andere mochten auch

Presentation Earth Saver Canvas Bags
Presentation Earth Saver Canvas BagsPresentation Earth Saver Canvas Bags
Presentation Earth Saver Canvas Bagsmcoprean
 
Docase notation for Haskell
Docase notation for HaskellDocase notation for Haskell
Docase notation for HaskellTomas Petricek
 
Doing data science with F#
Doing data science with F#Doing data science with F#
Doing data science with F#Tomas Petricek
 
Queries in general purpose languages
Queries in general purpose languagesQueries in general purpose languages
Queries in general purpose languagesTomas Petricek
 
Social Media in Small Business is Anything But Small
Social Media in Small Business is Anything But SmallSocial Media in Small Business is Anything But Small
Social Media in Small Business is Anything But SmallMark Schmulen
 

Andere mochten auch (8)

Presentation Earth Saver Canvas Bags
Presentation Earth Saver Canvas BagsPresentation Earth Saver Canvas Bags
Presentation Earth Saver Canvas Bags
 
Tics
TicsTics
Tics
 
Docase notation for Haskell
Docase notation for HaskellDocase notation for Haskell
Docase notation for Haskell
 
Doing data science with F#
Doing data science with F#Doing data science with F#
Doing data science with F#
 
Queries in general purpose languages
Queries in general purpose languagesQueries in general purpose languages
Queries in general purpose languages
 
F# on the Server-Side
F# on the Server-SideF# on the Server-Side
F# on the Server-Side
 
Academia
AcademiaAcademia
Academia
 
Social Media in Small Business is Anything But Small
Social Media in Small Business is Anything But SmallSocial Media in Small Business is Anything But Small
Social Media in Small Business is Anything But Small
 

Ähnlich wie F# Tutorial @ QCon

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
 
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
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010Satish Verma
 
Exploring SharePoint with F#
Exploring SharePoint with F#Exploring SharePoint with F#
Exploring SharePoint with F#Talbott Crowell
 
Programing paradigm &amp; implementation
Programing paradigm &amp; implementationPrograming paradigm &amp; implementation
Programing paradigm &amp; implementationBilal Maqbool ツ
 
Sudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdfSudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdfSudipta Mukherjee
 
Algorithm and Programming
Algorithm and ProgrammingAlgorithm and Programming
Algorithm and ProgrammingNidal Abusaleh
 
Envisioning the Future of Language Workbenches
Envisioning the Future of Language WorkbenchesEnvisioning the Future of Language Workbenches
Envisioning the Future of Language WorkbenchesMarkus Voelter
 
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
 
Key Features Of The Pseudo Code
Key Features Of The Pseudo CodeKey Features Of The Pseudo Code
Key Features Of The Pseudo CodeAngilina Jones
 
Procedural Programming Of Programming Languages
Procedural Programming Of Programming LanguagesProcedural Programming Of Programming Languages
Procedural Programming Of Programming LanguagesTammy Moncrief
 
OOP Comparative Study
OOP Comparative StudyOOP Comparative Study
OOP Comparative StudyDarren Tan
 
Introduction To Computer Programming
Introduction To Computer ProgrammingIntroduction To Computer Programming
Introduction To Computer ProgrammingHussain Buksh
 
OBJECT ORIENTED PROGRAMMING.docx
OBJECT ORIENTED PROGRAMMING.docxOBJECT ORIENTED PROGRAMMING.docx
OBJECT ORIENTED PROGRAMMING.docxAleKi2
 

Ähnlich wie F# Tutorial @ QCon (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
 
Introduction to F#
Introduction to F#Introduction to F#
Introduction to F#
 
Practical F#
Practical F#Practical F#
Practical F#
 
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
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
F# 101
F# 101F# 101
F# 101
 
Exploring SharePoint with F#
Exploring SharePoint with F#Exploring SharePoint with F#
Exploring SharePoint with F#
 
Programing paradigm &amp; implementation
Programing paradigm &amp; implementationPrograming paradigm &amp; implementation
Programing paradigm &amp; implementation
 
F# and the DLR
F# and the DLRF# and the DLR
F# and the DLR
 
Sudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdfSudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdf
 
Algorithm and Programming
Algorithm and ProgrammingAlgorithm and Programming
Algorithm and Programming
 
Envisioning the Future of Language Workbenches
Envisioning the Future of Language WorkbenchesEnvisioning the Future of Language Workbenches
Envisioning the Future of Language Workbenches
 
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?
 
Key Features Of The Pseudo Code
Key Features Of The Pseudo CodeKey Features Of The Pseudo Code
Key Features Of The Pseudo Code
 
Procedural Programming Of Programming Languages
Procedural Programming Of Programming LanguagesProcedural Programming Of Programming Languages
Procedural Programming Of Programming Languages
 
CLTL Software and Web Services
CLTL Software and Web Services CLTL Software and Web Services
CLTL Software and Web Services
 
1504.00693
1504.006931504.00693
1504.00693
 
OOP Comparative Study
OOP Comparative StudyOOP Comparative Study
OOP Comparative Study
 
Introduction To Computer Programming
Introduction To Computer ProgrammingIntroduction To Computer Programming
Introduction To Computer Programming
 
OBJECT ORIENTED PROGRAMMING.docx
OBJECT ORIENTED PROGRAMMING.docxOBJECT ORIENTED PROGRAMMING.docx
OBJECT ORIENTED PROGRAMMING.docx
 

Mehr von Tomas Petricek

Coeffects: A Calculus of Context-Dependent Computation
Coeffects: A Calculus of Context-Dependent ComputationCoeffects: A Calculus of Context-Dependent Computation
Coeffects: A Calculus of Context-Dependent ComputationTomas Petricek
 
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional WayDomain Specific Languages: The Functional Way
Domain Specific Languages: The Functional WayTomas Petricek
 
F# Data: Making structured data first class citizens
F# Data: Making structured data first class citizensF# Data: Making structured data first class citizens
F# Data: Making structured data first class citizensTomas Petricek
 
Doing data science with F# (BuildStuff)
Doing data science with F# (BuildStuff)Doing data science with F# (BuildStuff)
Doing data science with F# (BuildStuff)Tomas Petricek
 
How F# Learned to Stop Worrying and Love the Data
How F# Learned to Stop Worrying and Love the DataHow F# Learned to Stop Worrying and Love the Data
How F# Learned to Stop Worrying and Love the DataTomas Petricek
 
Information-rich programming in F# (ML Workshop 2012)
Information-rich programming in F# (ML Workshop 2012)Information-rich programming in F# (ML Workshop 2012)
Information-rich programming in F# (ML Workshop 2012)Tomas Petricek
 
Asynchronous programming in F# (QCon 2012)
Asynchronous programming in F# (QCon 2012)Asynchronous programming in F# (QCon 2012)
Asynchronous programming in F# (QCon 2012)Tomas Petricek
 
Concurrent programming with Agents
Concurrent programming with AgentsConcurrent programming with Agents
Concurrent programming with AgentsTomas Petricek
 

Mehr von Tomas Petricek (9)

Coeffects: A Calculus of Context-Dependent Computation
Coeffects: A Calculus of Context-Dependent ComputationCoeffects: A Calculus of Context-Dependent Computation
Coeffects: A Calculus of Context-Dependent Computation
 
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional WayDomain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
 
F# Data: Making structured data first class citizens
F# Data: Making structured data first class citizensF# Data: Making structured data first class citizens
F# Data: Making structured data first class citizens
 
Doing data science with F# (BuildStuff)
Doing data science with F# (BuildStuff)Doing data science with F# (BuildStuff)
Doing data science with F# (BuildStuff)
 
How F# Learned to Stop Worrying and Love the Data
How F# Learned to Stop Worrying and Love the DataHow F# Learned to Stop Worrying and Love the Data
How F# Learned to Stop Worrying and Love the Data
 
Information-rich programming in F# (ML Workshop 2012)
Information-rich programming in F# (ML Workshop 2012)Information-rich programming in F# (ML Workshop 2012)
Information-rich programming in F# (ML Workshop 2012)
 
Asynchronous programming in F# (QCon 2012)
Asynchronous programming in F# (QCon 2012)Asynchronous programming in F# (QCon 2012)
Asynchronous programming in F# (QCon 2012)
 
Teaching F#
Teaching F#Teaching F#
Teaching F#
 
Concurrent programming with Agents
Concurrent programming with AgentsConcurrent programming with Agents
Concurrent programming with Agents
 

Kürzlich hochgeladen

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 

Kürzlich hochgeladen (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 

F# Tutorial @ QCon

  • 1. Turning to the Functional side(Using C# and F#) Phil Trelford http://trelford.com/blog@ptrelford Tomas Petricek http://tomasp.net/blog@tomaspetricek
  • 2. About Us Tomas Author of F# book for C# programmers Worked with the F# team at Microsoft First blogged about F# in May 2006 Phil Software Developer and Architect Worked on first F# applications at Microsoft Co-organizer of London F# User Group
  • 3. Tutorial Goals Introduce Functional Concepts with F# and C# Non-goals Provide in-depth understanding Mass conversion to functional programming cult Sell books
  • 4. Jargon Buster OO = Object Orientated FP = Functional Programming Lambda = Anonymous Function DSL = Domain Specific Language
  • 8. F# is a mix of
  • 9. What is F#? F# is multi-paradigm language, that is: Functional Declarative Object Orientated Imperative .Net language with VS integration
  • 10. Running F# Visual Studio 2010 Visual Studio Shell + F# MonoDevelop on Linux and Mac F# Compiler + Emacs etc. In your browser
  • 11. FP hits mainstream Visual Studio gets F# C# gets LINQ, lambdas, etc C++ gets lambdas JVM gets Clojure & Scala
  • 12. Writing queries with LINQ Query syntax supported in C# 3.0 Functional programming concepts Declaratively describes “what” not “how” Written as single expression varq= frompindb.Products wherep.UnitPrice>75.0M selectString.Format("{0} - ${1}", p.ProductName, p.UnitPrice);
  • 13. Graphical User Interface Frameworks XUL (Mozilla), Glade (Gtk), XAML (.NET) Functional programming concepts Compose button with ellipse inside Specify behavior declaratively <Buttonx:Name="greenBtn" Background="Black"> <EllipseWidth="75"Height="75" Fill="LightGreen" /> </Button> <DoubleAnimationStoryboard.TargetName="greenBtn" Storyboard.TargetProperty="(Canvas.Left)" From="0.0"To="100.0"Duration="0:0:5" />
  • 14. Specifying financial contracts in F# Functional programming concepts Declaratively describes “what” not “how” Written as single expression Composed from small number of primitives letmarch day = DateTime(2011, 3, day) letitTrades = (sell (tradeAt(march15) "GOOG"500)) $ (between (march10) (march19) (trade"MSFT"1000)) lettradeAtdatewhatamount = between datedate (trade whatamount)
  • 15. Code Samples 1: // Declare a local value (inferred type is string) 2: letworld="world" 3: 4: // Using '%s' format specifier to include string parameter 5: printfn"Hello %s!"world  
  • 16.
  • 17. Functional data structures A way of thinking about problems Model data using composition of primitives Tuple Combine two values of different types Discriminated Union Represents one of several options List Zero or more values of the same type
  • 18. Tuples: Containers for a few different things
  • 20. Representing event schedule Object-oriented way Easy to add new cases Hard to add new functions Functional way Easy to add new functions Hard to add new cases Good thing about F# and Scala– you can use both!
  • 22. Map Reduce MapReduce is a patented software framework introduced by Google to support distributed computing on large data sets on clusters of computers. Functional design scales extremely well!
  • 23. Domain Modelling Retail Domain -> Testing
  • 24. Checkout application workflow Think of a simple while loop Implement… Mutable field to keep the state and event handlers? Asynchronous while loop in F#
  • 25. Asynchronous and concurrent programming Asynchronous GUI in Checkout example Single-threaded thanks to Async.StartImmediate Easy way to encode control flow Parallel programming Workflows are non-blocking computations Run workflows in parallel with Async.Parallel Concurrent programming Compose application from (thousands of) agents Agents communicate using messages
  • 26. Wild Card Filler Silverlight mini-samples
  • 27. Summary FP is already in the mainstream FP languages are ready Start small, go big Language Orientated Programming Exploratory and Scripting Asynchronous & Concurrency Technical Computing Testing
  • 28. Summary Don’t underestimate the power of the functional side
  • 31. On the horizon Next Meet: In the brain of Rob Pickering on March 16th
  • 32. Q & A http://Fsharp.net http://fssnip.net http://tomasp.net/blog http://trelford.com/blog

Hinweis der Redaktion

  1. Thoughtworkstechnlogy radar: http://www.thoughtworks.com/radar/Image source: http://www.thoughtworks.com/sites/www.thoughtworks.com/files/files/tw-radar-april-2010.pdfSee also: http://qconlondon.com/london-2010/file?path=/qcon-london-2010/slides/AmandaLaucher_and_JoshGraham_TheStateOfTheArtNET12MonthsOfThingsToLearn.pdf
  2. http://en.wikipedia.org/wiki/Dynamic_programming_language
  3. http://en.wikipedia.org/wiki/Comparison_of_programming_languagesDefinitions of FP, OO and Dynamic
  4. Python = light, C# = OO, OCaml = Functional
  5. http://tryfsharporg.cloudapp.net/http://trelford.com/MissileCommand.fsx