An Introduction to FSharp

Post on 26-Jun-2015

568 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

This is the companion slides of a talk I gave for the .NET Miami user group on April 19th, 2012.

Transcript

An Introduction to F#

Horacio Nunez

{hnh12358@gmail.com, horatio.info}

What is F#?

F# Interactive

F# 101 (less than 10 minutes!)

Walkthrough: Functional Numerical Matrixes

Online Resources

F# is multi-paradigm programming language targeting

the .NET framework

functional

object oriented

imperative

language oriented

F#

Immutable values and data types

(No State => No Shared Memory)

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

High Order Functions

(functions can be parameters and results of other functions)

Type Inference

Think in C#’s var… everywhere

Declarative

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

Lazy Evaluation

Use values only when you really need it

Pattern Matching

The compiler “understands” types

Imperative

Mutable values and data types

(State => Probable Shared Memory)

let mutable x = 10x <- 10

Object Oriented

F# can consume and create OOP designs seamlessly

also…

F# becomes MSIL, hard to read, but MSIL

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

What is F#?

F# Interactive

F# 101 (less than 10 minutes!)

Walkthrough: Functional Numerical Matrixs

Online Resources

What is F#?

F# Interactive

F# 101 (less than 10 minutes!)

Walkthrough: Functional Numerical Matrixs

Online Resources

What is F#?

F# Interactive

F# 101 (less than 10 minutes!)

Walkthrough: Functional Numerical Matrixs

Online Resources

Functional Abstractions for Numerical Matrixes

(𝑎 𝑏𝑐 𝑑)

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

Out of Memory Exception!

What is F#?

F# Interactive

F# 101 (less than 10 minutes!)

Walkthrough: Functional Numerical Matrixs

Online Resources

ONLINE RESOURCES

Don Syme’ Blog (F# Designer)

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

Tomas Petricek's’ Blog

http://tomasp.net/

ONLINE RESOURCES

F# Snippets

http://fssnip.net/

Channel 9

http://channel9.msdn.com/

StackOverflow

http://stackoverflow.com/

top related