SlideShare a Scribd company logo
1 of 28
KEVIN AVIGNON
SHARPER TOOLS WITH F#
PRESENTATION KEY POINTS
1. TESTIMONIALS
2. FUNCTIONAL PROGRAMMING KEY CONCEPTS
3. OVERVIEW OF F# BASIC FEATURES
4. REFERENCES
1. TESTIMONIALS
F# WAS SO EASY TO PICK UP WE
WENT FROM COMPLETE NOVICES
TO HAVING OUR CODE IN
PRODUCTION IN LESS THAN A
WEEK.
O’Connor’s Online - Jack Mott
WE ALSO FOUND THAT IT WAS STRAIGHTFORWARD TO USE OUR NEW F# MODULE
FROM WITHIN OUR EXISTING C# CODE
THE F# CODE IS CONSISTENTLY
SHORTER, EASIER TO READ,
EASIER TO REFACTOR AND
CONTAINS FAR FEWER BUGS.
Kaggle
THE F# SOLUTION OFFERS US AN
ORDER OF MAGNITUDE
INCREASE IN PRODUCTIVTY
GameSys - Yan Cui, Lead Server Engineer
PROGRAMMING IN F# FEELS
LIKE WRITING OUT IDEAS
RATHER THAN CODE
Maria Gorinova
2. FUNCTIONAL PROGRAMMING
KEY CONCEPTS
▸Accepting functions as arguments (High order function)
▸Returning functions inside functions
▸Storing functions inside data structures
▸Shouldn’t cause mutation or side-effects (pure functions)
▸Behaviour based on arguments
▸Functions in FP are equivalent to objects in OO
FUNCTIONS AS FIRST CLASS CITIZEN
▸States or values cannot be altered
▸Brings thread-safety
▸No mutable states shared amongst threads
▸No huge penalties when updating internal states
▸Creating new states from previous states
IMMUTABILITY
▸Combination of 1+ of
▸values, functions, operators, constants
▸Expressions are evaluated
▸Produces
▸return value (e.g numerical)
▸an expression (e.g a function)
EXPRESSIONS
▸When functions are calling themselves
▸Tail recursion when it’s the last expression of the function
▸No state required for recursion
▸Only read-only function arguments
▸Write-only return value
▸Function “iterates” in it’s own stack
▸Reduce memory usage on the stack
RECURSION
▸Functions can be broken down in arguments
▸Currying uses a series of functions from a “root” function
▸Curried functions can be passed to high order functions
▸Example:
▸add x y = x + y
▸incrementBy10 y = add 10 + y
PARTIAL FUNCTION APPLICATION (CURRYING)
3. OVERVIEW OF F# BASIC
FEATURES
▸Top-down & left-right
▸The location of functions and types matters
▸The location of source file in the project matters
▸Indentation is key in source files
FILE SYSTEM HIERARCHY
▸An allocation followed by an assignment
▸When allocating values or functions to same symbol (variable)
▸It becomes shadowed - lost in space
▸Compiler infers type to value
LET BINDING
▸Grouping of code
▸Can contain : modules, type definitions, values, constants
▸ Implemented as a static CLR class with static members.
▸Module can be defined as
▸Top level : Whole file (Don’t need to indent)
▸Locally (requires indentation)
MODULES
▸Discriminated unions: Heterogenous data
▸Similar to the union type in C++ but each option as an case identifier
▸Equivalent to enumerations when cases have no value
▸type Shape = | Rectangle | Circle | Square
▸Records: Set of named values
▸type Point3D = { x : float; y : float; z : float }
▸A record can be updated with keyword with
▸Tuples: Set of unnamed and ordered values
▸int * int
CORE DATA STRUCTURES
▸A pattern is a rule for transforming data
▸Data is decomposed when it’s being matched on a pattern to find a match
▸Possible to match on Tuple, Discriminated union, Records, collections, etc
▸match [something] with | pattern1 -> expression1
▸Compiler can see when you forget cases
▸_ is a wildcard pattern to ignore the remaining cases
PATTERN MATCHING
▸If in F# are expressions, not statements like in C#
▸Each branch must return an expression
▸The else branch is optional when if returns no value (unit)
▸Expressions must be of the same type
▸Cannot return int in if and bool in else for instance
IF EXPRESSIONS
▸Common collections in F# : List ( [] ) , Array ( [| |] ), Seq ( ses { } )
▸They basically have the same API
▸You can find functions such as
▸tryFind
▸length
▸map
▸Filter
▸min/max
▸sum
▸average
HIGH ORDER FUNCTIONS ON COLLECTIONS
▸For loop
▸for I = 0 to 10 do …
▸for i = 10 downto 0 do ….
▸Foreach loop
▸for i in [0..100] do …
▸for i in [2..2..50] do …
LOOPING
▸The pipe operators are syntactic sugar for chained method calls
▸Pipe-forward ( |> )
▸Lets you input an intermediate result onto the next function
▸[1..10] |> List.filter (fun integer -> integer % 2 = 0) (Result : [2;4;6;8;10])
▸ Pipe-backward ( <| )
▸Takes a function from the left and applies its return value/expression to the right
▸printfn “The value of 3 when tripled %d” <| tripleValue 3 vs
▸Printfn “The value of 3 when tripled %d” (tripleValue 3)
PIPELINE OPERATORS
▸Bound values to a type
▸Operations can be made on values of same type
▸A unit of measure is a type
▸They can be given as arguments
▸Type inference
▸Values can be multiplied/divided and even converted
▸Not part of the .NET type system
▸Can’t be accessed by C#/VB
UNIT OF MEASURE
▸Match a specific interface
▸Loaded types by compiler at design time
▸Set of of System.Type instances
▸Each type has a corresponding type in .NET
▸+ Compile-time check on data source
▸+ Provider can recognize change in data source and adapt
▸+ Uniform mechanism for data access
▸Examples: Entity Framework, JSON, XML, Yaml, CSV, HTML, R, Powershell
TYPE PROVIDERS
REFERENCES
▸ Book : F# for C# developers
▸ Book : F# deep dives
▸ http://fsharpforfunandprofit.com
▸ https://github.com/ChrisMarinos/FSharpKoans#functional-koans---f
▸ http://foundation.fsharp.org/join
▸ https://en.wikibooks.org/wiki/F_Sharp_Programming

More Related Content

What's hot

Functional programming in Python
Functional programming in PythonFunctional programming in Python
Functional programming in Python
Colin Su
 
Swift the implicit parts
Swift the implicit partsSwift the implicit parts
Swift the implicit parts
Maxim Zaks
 

What's hot (20)

Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)
 
Write Your Own Compiler in 24 Hours
Write Your Own Compiler in 24 HoursWrite Your Own Compiler in 24 Hours
Write Your Own Compiler in 24 Hours
 
F# 101
F# 101F# 101
F# 101
 
User Defined Functions in C Language
User Defined Functions   in  C LanguageUser Defined Functions   in  C Language
User Defined Functions in C Language
 
Functional programming in Python
Functional programming in PythonFunctional programming in Python
Functional programming in Python
 
Call by value or call by reference in C++
Call by value or call by reference in C++Call by value or call by reference in C++
Call by value or call by reference in C++
 
Docase notation for Haskell
Docase notation for HaskellDocase notation for Haskell
Docase notation for Haskell
 
C++ functions presentation by DHEERAJ KATARIA
C++ functions presentation by DHEERAJ KATARIAC++ functions presentation by DHEERAJ KATARIA
C++ functions presentation by DHEERAJ KATARIA
 
Functions
FunctionsFunctions
Functions
 
Function in c program
Function in c programFunction in c program
Function in c program
 
Function Composition - forward composition versus backward composition
Function Composition - forward composition versus backward compositionFunction Composition - forward composition versus backward composition
Function Composition - forward composition versus backward composition
 
Teaching F#
Teaching F#Teaching F#
Teaching F#
 
Python 3000
Python 3000Python 3000
Python 3000
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Advance python programming
Advance python programming Advance python programming
Advance python programming
 
Lecture#7 Call by value and reference in c++
Lecture#7 Call by value and reference in c++Lecture#7 Call by value and reference in c++
Lecture#7 Call by value and reference in c++
 
PARAMETER PASSING MECHANISMS
PARAMETER PASSING MECHANISMSPARAMETER PASSING MECHANISMS
PARAMETER PASSING MECHANISMS
 
C++ functions
C++ functionsC++ functions
C++ functions
 
Swift the implicit parts
Swift the implicit partsSwift the implicit parts
Swift the implicit parts
 

Similar to Sharper tools with F#

Lecture 2 - C Programming.pdf
Lecture 2 - C Programming.pdfLecture 2 - C Programming.pdf
Lecture 2 - C Programming.pdf
ssuser02936f
 
An Overview Of Python With Functional Programming
An Overview Of Python With Functional ProgrammingAn Overview Of Python With Functional Programming
An Overview Of Python With Functional Programming
Adam Getchell
 
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
DRVaibhavmeshram1
 

Similar to Sharper tools with F# (20)

Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
 
Lecture 2 - C Programming.pdf
Lecture 2 - C Programming.pdfLecture 2 - C Programming.pdf
Lecture 2 - C Programming.pdf
 
C structure
C structureC structure
C structure
 
An Overview Of Python With Functional Programming
An Overview Of Python With Functional ProgrammingAn Overview Of Python With Functional Programming
An Overview Of Python With Functional Programming
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
Function in c language(defination and declaration)
Function in c language(defination and declaration)Function in c language(defination and declaration)
Function in c language(defination and declaration)
 
Python Programming - Functions and Modules
Python Programming - Functions and ModulesPython Programming - Functions and Modules
Python Programming - Functions and Modules
 
Functionincprogram
FunctionincprogramFunctionincprogram
Functionincprogram
 
Pres_python_talakhoury_26_09_2023.pdf
Pres_python_talakhoury_26_09_2023.pdfPres_python_talakhoury_26_09_2023.pdf
Pres_python_talakhoury_26_09_2023.pdf
 
unit_2 (1).pptx
unit_2 (1).pptxunit_2 (1).pptx
unit_2 (1).pptx
 
3. functions modules_programs (1)
3. functions modules_programs (1)3. functions modules_programs (1)
3. functions modules_programs (1)
 
C by balaguruswami - e.balagurusamy
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamy
 
C++ Overview PPT
C++ Overview PPTC++ Overview PPT
C++ Overview PPT
 
C++
C++C++
C++
 
Python basic
Python basicPython basic
Python basic
 
c++ referesher 1.pdf
c++ referesher 1.pdfc++ referesher 1.pdf
c++ referesher 1.pdf
 
Preprocessor directives
Preprocessor directivesPreprocessor directives
Preprocessor directives
 
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
 
Functions
Functions Functions
Functions
 
Typescript language extension of java script
Typescript language extension of java scriptTypescript language extension of java script
Typescript language extension of java script
 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 

Recently uploaded (20)

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 

Sharper tools with F#

  • 2. PRESENTATION KEY POINTS 1. TESTIMONIALS 2. FUNCTIONAL PROGRAMMING KEY CONCEPTS 3. OVERVIEW OF F# BASIC FEATURES 4. REFERENCES
  • 4. F# WAS SO EASY TO PICK UP WE WENT FROM COMPLETE NOVICES TO HAVING OUR CODE IN PRODUCTION IN LESS THAN A WEEK. O’Connor’s Online - Jack Mott WE ALSO FOUND THAT IT WAS STRAIGHTFORWARD TO USE OUR NEW F# MODULE FROM WITHIN OUR EXISTING C# CODE
  • 5. THE F# CODE IS CONSISTENTLY SHORTER, EASIER TO READ, EASIER TO REFACTOR AND CONTAINS FAR FEWER BUGS. Kaggle
  • 6. THE F# SOLUTION OFFERS US AN ORDER OF MAGNITUDE INCREASE IN PRODUCTIVTY GameSys - Yan Cui, Lead Server Engineer
  • 7. PROGRAMMING IN F# FEELS LIKE WRITING OUT IDEAS RATHER THAN CODE Maria Gorinova
  • 8.
  • 10. ▸Accepting functions as arguments (High order function) ▸Returning functions inside functions ▸Storing functions inside data structures ▸Shouldn’t cause mutation or side-effects (pure functions) ▸Behaviour based on arguments ▸Functions in FP are equivalent to objects in OO FUNCTIONS AS FIRST CLASS CITIZEN
  • 11. ▸States or values cannot be altered ▸Brings thread-safety ▸No mutable states shared amongst threads ▸No huge penalties when updating internal states ▸Creating new states from previous states IMMUTABILITY
  • 12. ▸Combination of 1+ of ▸values, functions, operators, constants ▸Expressions are evaluated ▸Produces ▸return value (e.g numerical) ▸an expression (e.g a function) EXPRESSIONS
  • 13. ▸When functions are calling themselves ▸Tail recursion when it’s the last expression of the function ▸No state required for recursion ▸Only read-only function arguments ▸Write-only return value ▸Function “iterates” in it’s own stack ▸Reduce memory usage on the stack RECURSION
  • 14. ▸Functions can be broken down in arguments ▸Currying uses a series of functions from a “root” function ▸Curried functions can be passed to high order functions ▸Example: ▸add x y = x + y ▸incrementBy10 y = add 10 + y PARTIAL FUNCTION APPLICATION (CURRYING)
  • 15. 3. OVERVIEW OF F# BASIC FEATURES
  • 16. ▸Top-down & left-right ▸The location of functions and types matters ▸The location of source file in the project matters ▸Indentation is key in source files FILE SYSTEM HIERARCHY
  • 17. ▸An allocation followed by an assignment ▸When allocating values or functions to same symbol (variable) ▸It becomes shadowed - lost in space ▸Compiler infers type to value LET BINDING
  • 18. ▸Grouping of code ▸Can contain : modules, type definitions, values, constants ▸ Implemented as a static CLR class with static members. ▸Module can be defined as ▸Top level : Whole file (Don’t need to indent) ▸Locally (requires indentation) MODULES
  • 19. ▸Discriminated unions: Heterogenous data ▸Similar to the union type in C++ but each option as an case identifier ▸Equivalent to enumerations when cases have no value ▸type Shape = | Rectangle | Circle | Square ▸Records: Set of named values ▸type Point3D = { x : float; y : float; z : float } ▸A record can be updated with keyword with ▸Tuples: Set of unnamed and ordered values ▸int * int CORE DATA STRUCTURES
  • 20. ▸A pattern is a rule for transforming data ▸Data is decomposed when it’s being matched on a pattern to find a match ▸Possible to match on Tuple, Discriminated union, Records, collections, etc ▸match [something] with | pattern1 -> expression1 ▸Compiler can see when you forget cases ▸_ is a wildcard pattern to ignore the remaining cases PATTERN MATCHING
  • 21. ▸If in F# are expressions, not statements like in C# ▸Each branch must return an expression ▸The else branch is optional when if returns no value (unit) ▸Expressions must be of the same type ▸Cannot return int in if and bool in else for instance IF EXPRESSIONS
  • 22. ▸Common collections in F# : List ( [] ) , Array ( [| |] ), Seq ( ses { } ) ▸They basically have the same API ▸You can find functions such as ▸tryFind ▸length ▸map ▸Filter ▸min/max ▸sum ▸average HIGH ORDER FUNCTIONS ON COLLECTIONS
  • 23. ▸For loop ▸for I = 0 to 10 do … ▸for i = 10 downto 0 do …. ▸Foreach loop ▸for i in [0..100] do … ▸for i in [2..2..50] do … LOOPING
  • 24. ▸The pipe operators are syntactic sugar for chained method calls ▸Pipe-forward ( |> ) ▸Lets you input an intermediate result onto the next function ▸[1..10] |> List.filter (fun integer -> integer % 2 = 0) (Result : [2;4;6;8;10]) ▸ Pipe-backward ( <| ) ▸Takes a function from the left and applies its return value/expression to the right ▸printfn “The value of 3 when tripled %d” <| tripleValue 3 vs ▸Printfn “The value of 3 when tripled %d” (tripleValue 3) PIPELINE OPERATORS
  • 25. ▸Bound values to a type ▸Operations can be made on values of same type ▸A unit of measure is a type ▸They can be given as arguments ▸Type inference ▸Values can be multiplied/divided and even converted ▸Not part of the .NET type system ▸Can’t be accessed by C#/VB UNIT OF MEASURE
  • 26. ▸Match a specific interface ▸Loaded types by compiler at design time ▸Set of of System.Type instances ▸Each type has a corresponding type in .NET ▸+ Compile-time check on data source ▸+ Provider can recognize change in data source and adapt ▸+ Uniform mechanism for data access ▸Examples: Entity Framework, JSON, XML, Yaml, CSV, HTML, R, Powershell TYPE PROVIDERS
  • 27.
  • 28. REFERENCES ▸ Book : F# for C# developers ▸ Book : F# deep dives ▸ http://fsharpforfunandprofit.com ▸ https://github.com/ChrisMarinos/FSharpKoans#functional-koans---f ▸ http://foundation.fsharp.org/join ▸ https://en.wikibooks.org/wiki/F_Sharp_Programming