SlideShare a Scribd company logo
1 of 22
A language you can brag about
Functional programming

     The new hotness
    Next “big” .NET language

     CTP this summer
OCaml offspring

    Created by MS Research

    Mixed mode language

     Functional
     OO
     Imperative (if you must)
    Statically typed

Yay! Type inference
                 
let x = 7
                     ...also, immutable
                 
let s = quot;kurtquot;
let pi = 3.142       So, really just “values”
                 
let l = ['a';'b';'c';]
// char list or list<char>
                                 Singly linked list
                             
                                 Still immutable!
                             
let digits = [0..9]
// int list
IEnumerable<T>
                    
let s = {1..10}
                        Useful for computing
                    
// seq[1;2;3;...]
                        unbounded lists
let me = (quot;kurtquot;, 6.0)
                             Typed groups of values
                         
// string * float
                             Can “hold” anything
                         
let point3d = (0,0,0)        Basically awesome
                         
// int * int * int
let add x y = x + y
                           Like any other value
                       
// int -> int -> int
                           More type inference
                       
let eight = add 3 5        Returns last expression
                       
// eight = 8
Look ma! Generics!
                         
let group x y = (x,y)
// 'a -> 'b -> 'a * 'b        Auto-generalization
let rec fib n =
    if n < 2 then
        n
                              Explicitly recursive
                          
    else
                              Tail recursion
                          
        (fib (n - 1)) +
        (fib (n - 2))
type name = string
type number = int
type date = System.DateTime
type meeting =
    | Personal of name   * date
    | Phone    of number * date

let review = Personal(quot;Jasminequot;,System.DateTime.Now)
let call = Phone(8675309, System.DateTime.Now)
let what_to_do (m : meeting) =
    match m with
    | Personal(name,date) ->
        printfn quot;Meeting with %s at %Aquot; name date
    | Phone(phone, date) ->
        printfn quot;Call %A at %Aquot; phone date
Functions are basic units of a program

    We can mix them up in interesting ways

     Less OO design patterns!
    “Cheap” functions are good

     Code is more expressive
let add3 = add 3
let add x y = x + y
                       // int -> int
// int -> int -> int
let even x = x % 2 = 0
                            // int -> bool
                            let numbers = [1..20]
let (|>) x f = f x          // int list
                            let evens =
// 'a -> ('a -> 'b) -> 'b
                                numbers |>
                                    List.filter even
                            // int list
List.fold_left
                           // ('b -> 'a -> 'b) ->
List.map
                           // 'b ->
// ('a -> 'b) ->
                           // 'a list ->
// 'a list ->
                           // 'b
// 'b list
                           [1..10] |> List.fold_left
[1..10] |> List.map add3
                             (fun acc x -> acc + x) 0
// [4;5;6;..;13]
                           // 55
2520 is the smallest number that can be

    divided by each of the numbers from 1 to 10
    without any remainder.
    What is the smallest number that is evenly

    divisible by all of the numbers from 1 to 20?
                                      - Project Euler
                                   projecteuler.net
“Mutable” keyword

     For real variables
    There are imperative loops

     Try not to use it too much
F# can be OO

     Classes
     Interfaces
     Inheritance
    Cross language work

     “Hide” implementation
type OrderLine(n:string, q:int, p:float) =
    let mutable currName = n
    let mutable currQuantity = q
    let mutable currPrice = p
    new (name, price) = OrderLine(name, 1, price)
    member x.Name
        with get() = currName
        and set name = currName <- name
    member x.SubTotal with get() =
        (Float.of_int quantity) * price
    member x.OneMore() =
        currQuantity <- currQuantity + 1
        currQuantity
Why functional programming?

     Easy to build incrementally
     Simplified testing
     Concurrency!
    Imperative can be good too

     At times, it’s wickedly fast
     It’s what we know
F# Presentation

More Related Content

What's hot

XSS Magic tricks
XSS Magic tricksXSS Magic tricks
XSS Magic tricksGarethHeyes
 
HSC ICT c program question answer/program solve
HSC ICT c program question answer/program solveHSC ICT c program question answer/program solve
HSC ICT c program question answer/program solveAmirul Islam
 
Pentesting Modern Web Apps: A Primer
Pentesting Modern Web Apps: A PrimerPentesting Modern Web Apps: A Primer
Pentesting Modern Web Apps: A PrimerBrian Hysell
 
Flutter presentation.pptx
Flutter presentation.pptxFlutter presentation.pptx
Flutter presentation.pptxFalgunSorathiya
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionDeep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionVishal Kumar
 
Regular Expression (Regex) Fundamentals
Regular Expression (Regex) FundamentalsRegular Expression (Regex) Fundamentals
Regular Expression (Regex) FundamentalsMesut Günes
 
[JSDC 2015] Turf.js - 地理資訊的分析與地圖視覺化
[JSDC 2015] Turf.js - 地理資訊的分析與地圖視覺化[JSDC 2015] Turf.js - 地理資訊的分析與地圖視覺化
[JSDC 2015] Turf.js - 地理資訊的分析與地圖視覺化Kuro Hsu
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in cBUBT
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesCarol McDonald
 
Pentesting Using Burp Suite
Pentesting Using Burp SuitePentesting Using Burp Suite
Pentesting Using Burp Suitejasonhaddix
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solutionAzhar Javed
 
Difference between-web-designing-and-web-development
Difference between-web-designing-and-web-developmentDifference between-web-designing-and-web-development
Difference between-web-designing-and-web-developmentGlobal Media Insight
 
Mobile DevOps pipeline using Google Flutter
Mobile DevOps pipeline using Google FlutterMobile DevOps pipeline using Google Flutter
Mobile DevOps pipeline using Google FlutterAhmed Abu Eldahab
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourSoroush Dalili
 
Automating Web Application Security Testing With OWASP ZAP DOT NET API - Tech...
Automating Web Application Security Testing With OWASP ZAP DOT NET API - Tech...Automating Web Application Security Testing With OWASP ZAP DOT NET API - Tech...
Automating Web Application Security Testing With OWASP ZAP DOT NET API - Tech...gmaran23
 
Web PenTest Sample Report
Web PenTest Sample ReportWeb PenTest Sample Report
Web PenTest Sample ReportOctogence
 

What's hot (20)

XSS Magic tricks
XSS Magic tricksXSS Magic tricks
XSS Magic tricks
 
HSC ICT c program question answer/program solve
HSC ICT c program question answer/program solveHSC ICT c program question answer/program solve
HSC ICT c program question answer/program solve
 
Pentesting Modern Web Apps: A Primer
Pentesting Modern Web Apps: A PrimerPentesting Modern Web Apps: A Primer
Pentesting Modern Web Apps: A Primer
 
Flutter presentation.pptx
Flutter presentation.pptxFlutter presentation.pptx
Flutter presentation.pptx
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionDeep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL Injection
 
Regular Expression (Regex) Fundamentals
Regular Expression (Regex) FundamentalsRegular Expression (Regex) Fundamentals
Regular Expression (Regex) Fundamentals
 
[JSDC 2015] Turf.js - 地理資訊的分析與地圖視覺化
[JSDC 2015] Turf.js - 地理資訊的分析與地圖視覺化[JSDC 2015] Turf.js - 地理資訊的分析與地圖視覺化
[JSDC 2015] Turf.js - 地理資訊的分析與地圖視覺化
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in c
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security Vulnerabilities
 
Pentesting Using Burp Suite
Pentesting Using Burp SuitePentesting Using Burp Suite
Pentesting Using Burp Suite
 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
 
Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
 
Difference between-web-designing-and-web-development
Difference between-web-designing-and-web-developmentDifference between-web-designing-and-web-development
Difference between-web-designing-and-web-development
 
Web Development Life Cycle
Web Development Life CycleWeb Development Life Cycle
Web Development Life Cycle
 
Mobile DevOps pipeline using Google Flutter
Mobile DevOps pipeline using Google FlutterMobile DevOps pipeline using Google Flutter
Mobile DevOps pipeline using Google Flutter
 
Asp.Net Tutorials
Asp.Net TutorialsAsp.Net Tutorials
Asp.Net Tutorials
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
 
Automating Web Application Security Testing With OWASP ZAP DOT NET API - Tech...
Automating Web Application Security Testing With OWASP ZAP DOT NET API - Tech...Automating Web Application Security Testing With OWASP ZAP DOT NET API - Tech...
Automating Web Application Security Testing With OWASP ZAP DOT NET API - Tech...
 
Bootstrap ppt
Bootstrap pptBootstrap ppt
Bootstrap ppt
 
Web PenTest Sample Report
Web PenTest Sample ReportWeb PenTest Sample Report
Web PenTest Sample Report
 

Viewers also liked

Sequential file programming patterns and performance with .net
Sequential  file programming patterns and performance with .netSequential  file programming patterns and performance with .net
Sequential file programming patterns and performance with .netMichael Pavlovsky
 
Moq Presentation
Moq PresentationMoq Presentation
Moq PresentationLynxStar
 
Mock driven development using .NET
Mock driven development using .NETMock driven development using .NET
Mock driven development using .NETPuneet Ghanshani
 
Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013Scott Wlaschin
 
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
 
Principles and patterns for test driven development
Principles and patterns for test driven developmentPrinciples and patterns for test driven development
Principles and patterns for test driven developmentStephen Fuqua
 
An Introduction to Unit Test Using NUnit
An Introduction to Unit Test Using NUnitAn Introduction to Unit Test Using NUnit
An Introduction to Unit Test Using NUnitweili_at_slideshare
 
Clean Unit Test Patterns
Clean Unit Test PatternsClean Unit Test Patterns
Clean Unit Test PatternsFrank Appel
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practicesnickokiss
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesDerek Smith
 
Undertaking Cemetery Rehabilitation
Undertaking  Cemetery RehabilitationUndertaking  Cemetery Rehabilitation
Undertaking Cemetery Rehabilitationchicora
 
Ramesh Curriculum Vitae
Ramesh Curriculum VitaeRamesh Curriculum Vitae
Ramesh Curriculum Vitaeramesh77uom
 
Gei015.09 Seminar032409
Gei015.09 Seminar032409Gei015.09 Seminar032409
Gei015.09 Seminar032409sourcelv
 
09April2009 Assembly Presentation
09April2009   Assembly Presentation09April2009   Assembly Presentation
09April2009 Assembly Presentationnurarafah
 
Ataqueal Coraz N
Ataqueal Coraz NAtaqueal Coraz N
Ataqueal Coraz Namigo2007
 

Viewers also liked (20)

Introduction to F#
Introduction to F#Introduction to F#
Introduction to F#
 
F# intro
F# introF# intro
F# intro
 
Sequential file programming patterns and performance with .net
Sequential  file programming patterns and performance with .netSequential  file programming patterns and performance with .net
Sequential file programming patterns and performance with .net
 
Moq Presentation
Moq PresentationMoq Presentation
Moq Presentation
 
Mock driven development using .NET
Mock driven development using .NETMock driven development using .NET
Mock driven development using .NET
 
Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013
 
Functional Programming in C# and F#
Functional Programming in C# and F#Functional Programming in C# and F#
Functional Programming in C# and F#
 
Principles and patterns for test driven development
Principles and patterns for test driven developmentPrinciples and patterns for test driven development
Principles and patterns for test driven development
 
Unit Testing (C#)
Unit Testing (C#)Unit Testing (C#)
Unit Testing (C#)
 
TDD, BDD and mocks
TDD, BDD and mocksTDD, BDD and mocks
TDD, BDD and mocks
 
An Introduction to Unit Test Using NUnit
An Introduction to Unit Test Using NUnitAn Introduction to Unit Test Using NUnit
An Introduction to Unit Test Using NUnit
 
Clean Unit Test Patterns
Clean Unit Test PatternsClean Unit Test Patterns
Clean Unit Test Patterns
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
 
Undertaking Cemetery Rehabilitation
Undertaking  Cemetery RehabilitationUndertaking  Cemetery Rehabilitation
Undertaking Cemetery Rehabilitation
 
CRM
CRMCRM
CRM
 
Ramesh Curriculum Vitae
Ramesh Curriculum VitaeRamesh Curriculum Vitae
Ramesh Curriculum Vitae
 
Gei015.09 Seminar032409
Gei015.09 Seminar032409Gei015.09 Seminar032409
Gei015.09 Seminar032409
 
09April2009 Assembly Presentation
09April2009   Assembly Presentation09April2009   Assembly Presentation
09April2009 Assembly Presentation
 
Ataqueal Coraz N
Ataqueal Coraz NAtaqueal Coraz N
Ataqueal Coraz N
 

Similar to F# Presentation

Similar to F# Presentation (20)

Python quickstart for programmers: Python Kung Fu
Python quickstart for programmers: Python Kung FuPython quickstart for programmers: Python Kung Fu
Python quickstart for programmers: Python Kung Fu
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
Kotlin
KotlinKotlin
Kotlin
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick tour
 
Scala introduction
Scala introductionScala introduction
Scala introduction
 
Python for High School Programmers
Python for High School ProgrammersPython for High School Programmers
Python for High School Programmers
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
 
Groovy
GroovyGroovy
Groovy
 
C tutorial
C tutorialC tutorial
C tutorial
 
Python Workshop
Python  Workshop Python  Workshop
Python Workshop
 
Python
PythonPython
Python
 
LEX & YACC TOOL
LEX & YACC TOOLLEX & YACC TOOL
LEX & YACC TOOL
 
My First Rails Plugin - Usertext
My First Rails Plugin - UsertextMy First Rails Plugin - Usertext
My First Rails Plugin - Usertext
 
C to perl binding
C to perl bindingC to perl binding
C to perl binding
 
Python Workshop Part 2. LUG Maniapl
Python Workshop Part 2. LUG ManiaplPython Workshop Part 2. LUG Maniapl
Python Workshop Part 2. LUG Maniapl
 
Falcon初印象
Falcon初印象Falcon初印象
Falcon初印象
 
Functional Programming in F#
Functional Programming in F#Functional Programming in F#
Functional Programming in F#
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
 
SWP - A Generic Language Parser
SWP - A Generic Language ParserSWP - A Generic Language Parser
SWP - A Generic Language Parser
 

Recently uploaded

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
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)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

F# Presentation

  • 1. A language you can brag about
  • 2. Functional programming   The new hotness Next “big” .NET language   CTP this summer
  • 3. OCaml offspring  Created by MS Research  Mixed mode language   Functional  OO  Imperative (if you must) Statically typed 
  • 4. Yay! Type inference  let x = 7 ...also, immutable  let s = quot;kurtquot; let pi = 3.142 So, really just “values” 
  • 5. let l = ['a';'b';'c';] // char list or list<char> Singly linked list  Still immutable!  let digits = [0..9] // int list
  • 6. IEnumerable<T>  let s = {1..10} Useful for computing  // seq[1;2;3;...] unbounded lists
  • 7. let me = (quot;kurtquot;, 6.0) Typed groups of values  // string * float Can “hold” anything  let point3d = (0,0,0) Basically awesome  // int * int * int
  • 8. let add x y = x + y Like any other value  // int -> int -> int More type inference  let eight = add 3 5 Returns last expression  // eight = 8
  • 9. Look ma! Generics!  let group x y = (x,y) // 'a -> 'b -> 'a * 'b  Auto-generalization
  • 10. let rec fib n = if n < 2 then n Explicitly recursive  else Tail recursion  (fib (n - 1)) + (fib (n - 2))
  • 11. type name = string type number = int type date = System.DateTime type meeting = | Personal of name * date | Phone of number * date let review = Personal(quot;Jasminequot;,System.DateTime.Now) let call = Phone(8675309, System.DateTime.Now)
  • 12. let what_to_do (m : meeting) = match m with | Personal(name,date) -> printfn quot;Meeting with %s at %Aquot; name date | Phone(phone, date) -> printfn quot;Call %A at %Aquot; phone date
  • 13. Functions are basic units of a program  We can mix them up in interesting ways   Less OO design patterns! “Cheap” functions are good   Code is more expressive
  • 14. let add3 = add 3 let add x y = x + y // int -> int // int -> int -> int
  • 15. let even x = x % 2 = 0 // int -> bool let numbers = [1..20] let (|>) x f = f x // int list let evens = // 'a -> ('a -> 'b) -> 'b numbers |> List.filter even // int list
  • 16. List.fold_left // ('b -> 'a -> 'b) -> List.map // 'b -> // ('a -> 'b) -> // 'a list -> // 'a list -> // 'b // 'b list [1..10] |> List.fold_left [1..10] |> List.map add3 (fun acc x -> acc + x) 0 // [4;5;6;..;13] // 55
  • 17. 2520 is the smallest number that can be  divided by each of the numbers from 1 to 10 without any remainder. What is the smallest number that is evenly  divisible by all of the numbers from 1 to 20? - Project Euler projecteuler.net
  • 18. “Mutable” keyword   For real variables There are imperative loops   Try not to use it too much
  • 19. F# can be OO   Classes  Interfaces  Inheritance Cross language work   “Hide” implementation
  • 20. type OrderLine(n:string, q:int, p:float) = let mutable currName = n let mutable currQuantity = q let mutable currPrice = p new (name, price) = OrderLine(name, 1, price) member x.Name with get() = currName and set name = currName <- name member x.SubTotal with get() = (Float.of_int quantity) * price member x.OneMore() = currQuantity <- currQuantity + 1 currQuantity
  • 21. Why functional programming?   Easy to build incrementally  Simplified testing  Concurrency! Imperative can be good too   At times, it’s wickedly fast  It’s what we know