"introduction to f#" - south dakota code camp, november 5, 2011
DESCRIPTION
Seth Larson's presentation to South Dakota Code Camp about F#.TRANSCRIPT
![Page 1: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/1.jpg)
Introduction to F#
![Page 2: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/2.jpg)
What’s a Seth?
• SD Native • Graduated a couple times • Developer – Blend Interactive • Consultant • Founder – Sioux Falls Developers Group • Cofounder – This thing we’re at today
![Page 3: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/3.jpg)
Who are you?
• Java peoples? • .Net people? • Python/Ruby people? • Why are you interested?
![Page 4: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/4.jpg)
Goals
• Give a little background • Explain some of the basic FP ideas • Cover F# syntax basics
• Converting you to FP and F# is NOT my goal
![Page 5: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/5.jpg)
Functional Programming • First Class Functions • Higher-Order Functions • No Shared State • No Side Effects • Immutable data • Recursion
![Page 6: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/6.jpg)
Functional Principles
• Composition over Inheritance
• Separate functions from data
• Referential Transparency
![Page 7: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/7.jpg)
Composition Over Inheritance
• Write functions that transform known input to known output
• Output of one function is input to the next
• Things like LINQ o Repeater.DataSource = myList.Where(x=> x.Length >
5).OrderBy(x=>x.Name);
![Page 8: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/8.jpg)
Separate Functions From Data
• But why wouldn’t you want possibly re-usable functionality tightly bound to a specific data type?
![Page 9: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/9.jpg)
Together Separate • Method(x)
• But what if we want to use it on y?
• Method(y) • darn
• x.Method()
• Our brains probably
prefer this way, nothing wrong with that
• Since C# is taking on some FP concepts extension methods semi-allow for this
![Page 10: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/10.jpg)
Referential Transparency • ???
• When it comes to null references
![Page 11: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/11.jpg)
F# isn’t just functional • So I’m kind of wasting your time right?
• F# is multi-paradigm, but “functional first” o Object Oriented – Smalltalk o Functional – Lisp, Scala, Haskell, OCaml, etc. o Imperative – C
• "I like to think of F# as a strongly typed python for .net” – Don Syme, MS Research/Creator of F#
![Page 12: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/12.jpg)
Object Oriented Encapsulation
Inheritance Polymorphism
![Page 13: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/13.jpg)
Demo
![Page 14: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/14.jpg)
What industries? • Finance • Front Office • Banking • Games • 3D Graphics • Telecoms • Investment Banks • Advertising
![Page 15: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/15.jpg)
What companies? • Optiver • EDF • Computational Problems • Credit Suisse • Data Analytics • Measured Progress • guardian.co.uk
![Page 16: "Introduction to F#" - South Dakota Code Camp, November 5, 2011](https://reader033.vdocuments.net/reader033/viewer/2022052618/554bb8a2b4c9053a298b4b02/html5/thumbnails/16.jpg)
Questions