Functional Programming with F#: Getting Started & Basic Concepts

19
FUNCTIONAL PROGRAMMING WITH F# Getting Started & Basic Concepts

Transcript of Functional Programming with F#: Getting Started & Basic Concepts

Page 1: Functional Programming with F#: Getting Started & Basic Concepts

FUNCTIONAL PROGRAMMINGWITH F#Getting Started & Basic Concepts

Page 2: Functional Programming with F#: Getting Started & Basic Concepts

AGENDA

Basic Concepts

Immutable Collections: List & Sequence

OOP and .NET Framework support

Async

Xamarin: iOS + Android

MVC & Windows 8

Page 3: Functional Programming with F#: Getting Started & Basic Concepts

ABOUT US

ALEX CASQUETE

acasquete

Software Developer at Plain ConceptsMVP Client Development

JUAN M. GÓMEZContractor Software EngineerFounder Orchard HispanoXamarin Insider

[email protected]_jmgomez_

[email protected]

Page 4: Functional Programming with F#: Getting Started & Basic Concepts

THE CHALLENGES

Process large datasets

Scale to processors & computers

Easily testing

Declarative logic

Page 5: Functional Programming with F#: Getting Started & Basic Concepts

IMPERATIVE

“Take the next ticket from a list. If theticket is not printed, send to print. If there are more tickets in the list,

go to the beginning.”

Page 6: Functional Programming with F#: Getting Started & Basic Concepts

DECLARATIVE“Run the first command for

every ticket for which the secondcommand returns true.”

Page 7: Functional Programming with F#: Getting Started & Basic Concepts

DECLARATIVE“Send to print every ticket

that is not printed.”

Page 8: Functional Programming with F#: Getting Started & Basic Concepts

WHICH ONE DO YOU PREFER?

“Take the next ticket from a list. If the

ticket is not printed, send to print. If there

are more tickets in thelist, go to thebeginning.”

“Send to print everyticket that is not

printed.”

Page 9: Functional Programming with F#: Getting Started & Basic Concepts

THINKINGDIFΞRΞNTLY

Say “what” rather than “how”

Page 10: Functional Programming with F#: Getting Started & Basic Concepts

THINKING DIFΞRΞNTLY IN C#

Imperative

foreach (Ticket t in Tickets){

if (!t.IsPrinted){

Print(t);}

}

Declarative

Tickets .Where(t=>!t.IsPrinted).ToList().ForEach(t => Print(t));

Page 11: Functional Programming with F#: Getting Started & Basic Concepts

Demos, demos, demosBasic Concepts, collections, async, everything…

Page 12: Functional Programming with F#: Getting Started & Basic Concepts

RecapBasic concepts, Five C’s, Understanding F#

Page 13: Functional Programming with F#: Getting Started & Basic Concepts

FUNCTIONAL BASIC CONCEPTS

Immutability

Recursion

Higher order

Page 14: Functional Programming with F#: Getting Started & Basic Concepts

WHY USE F#?FIVE C’s

Conciseness

Convenience

Correctness

Concurrency

Completeness

Page 15: Functional Programming with F#: Getting Started & Basic Concepts

Understanding F#The vision of F#

Page 16: Functional Programming with F#: Getting Started & Basic Concepts

Data, Services, Information

Access

Transformations, Analysis,

Algorithms, Code, Parallel

Presentation, Publication, Experience

F# 3.0 F# 2.0 C#, HTML5, JS

Page 17: Functional Programming with F#: Getting Started & Basic Concepts

BOOKS

Page 18: Functional Programming with F#: Getting Started & Basic Concepts

MORE RESOURCES

http://Fsharp.org

http://FsharpForFunAndProfit.com

http://www.fssnip.net

Page 19: Functional Programming with F#: Getting Started & Basic Concepts

THANKS!

ANY QUESTION?

ALEX CASQUETE

acasquete

Software Developer at Plain ConceptsMVP Client Development

JUAN M. GÓMEZContractor Software EngineerFounder Orchard HispanoXamarin Insider

[email protected]_jmgomez_

[email protected]