Top Banner
An Introduction to F# Horacio Nunez {[email protected], horatio.info}
25

An Introduction to FSharp

Jun 26, 2015

Download

Technology

Horacio Nuñez

This is the companion slides of a talk I gave for the .NET Miami user group on April 19th, 2012.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: An Introduction to FSharp

An Introduction to F#

Horacio Nunez

{[email protected], horatio.info}

Page 2: An Introduction to FSharp

What is F#?

F# Interactive

F# 101 (less than 10 minutes!)

Walkthrough: Functional Numerical Matrixes

Online Resources

Page 3: An Introduction to FSharp

F# is multi-paradigm programming language targeting

the .NET framework

Page 4: An Introduction to FSharp

functional

object oriented

imperative

language oriented

F#

Page 5: An Introduction to FSharp

Immutable values and data types

(No State => No Shared Memory)

let x = 10x = 10 //<!-- boolean

Page 6: An Introduction to FSharp

High Order Functions

(functions can be parameters and results of other functions)

Page 7: An Introduction to FSharp

Type Inference

Think in C#’s var… everywhere

Page 8: An Introduction to FSharp

Declarative

Express the desired result, not the step-by-step recipe

Page 9: An Introduction to FSharp

Lazy Evaluation

Use values only when you really need it

Page 10: An Introduction to FSharp

Pattern Matching

The compiler “understands” types

Page 11: An Introduction to FSharp

Imperative

Page 12: An Introduction to FSharp

Mutable values and data types

(State => Probable Shared Memory)

let mutable x = 10x <- 10

Page 13: An Introduction to FSharp

Object Oriented

Page 14: An Introduction to FSharp

F# can consume and create OOP designs seamlessly

Page 15: An Introduction to FSharp

also…

F# becomes MSIL, hard to read, but MSIL

Page 16: An Introduction to FSharp

F# is fully supported in Visual Studio except for GUI Designers

Page 17: An Introduction to FSharp

What is F#?

F# Interactive

F# 101 (less than 10 minutes!)

Walkthrough: Functional Numerical Matrixs

Online Resources

Page 18: An Introduction to FSharp

What is F#?

F# Interactive

F# 101 (less than 10 minutes!)

Walkthrough: Functional Numerical Matrixs

Online Resources

Page 19: An Introduction to FSharp

What is F#?

F# Interactive

F# 101 (less than 10 minutes!)

Walkthrough: Functional Numerical Matrixs

Online Resources

Page 20: An Introduction to FSharp

Functional Abstractions for Numerical Matrixes

(𝑎 𝑏𝑐 𝑑)

Page 21: An Introduction to FSharp

Have you ever tried to create a Matrix of order Int32.MaxValue?

Page 22: An Introduction to FSharp

Out of Memory Exception!

Page 23: An Introduction to FSharp

What is F#?

F# Interactive

F# 101 (less than 10 minutes!)

Walkthrough: Functional Numerical Matrixs

Online Resources

Page 24: An Introduction to FSharp

ONLINE RESOURCES

Don Syme’ Blog (F# Designer)

http://blogs.msdn.com/b/dsyme/

Tomas Petricek's’ Blog

http://tomasp.net/

Page 25: An Introduction to FSharp

ONLINE RESOURCES

F# Snippets

http://fssnip.net/

Channel 9

http://channel9.msdn.com/

StackOverflow

http://stackoverflow.com/