Break Free with Managed Functional Programming: An Introduction to F#
-
Upload
dave-fancher -
Category
Technology
-
view
958 -
download
3
description
Transcript of Break Free with Managed Functional Programming: An Introduction to F#
![Page 1: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/1.jpg)
Break Free withManaged Functional
ProgrammingAn Introduction to F#
![Page 2: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/2.jpg)
A language that doesn't affect the way you think about programming, is not worth knowing.
Alan Perlis, Epigrams on Programming, 1982
![Page 3: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/3.jpg)
About Me• Dave Fancher• Blog: http://davefancher.com• Twitter: @davefancher• Email: [email protected]
![Page 4: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/4.jpg)
My Background
![Page 5: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/5.jpg)
![Page 6: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/6.jpg)
Why F#?
![Page 7: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/7.jpg)
LINQ: The Functional Gateway Drug• Learned about query syntax• The method syntax• Introduced me to functional principles
![Page 8: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/8.jpg)
JavaScript, Too!• Functions are first class citizens• Its most powerful features are enabled by closures
![Page 9: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/9.jpg)
Turning Functional• Began applying functional principles in my code• Immutability with readonly fields & properties• More delegation• Coding without side-effects
![Page 10: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/10.jpg)
C# Was Getting Frustrating• Verbose and repetitive• Fragile• Ceremonial
![Page 11: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/11.jpg)
An Accidental Discovery• Hanselminutes #311• F#
![Page 12: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/12.jpg)
So, what is this F# thing?
![Page 13: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/13.jpg)
F# is a succinct, expressive, and efficient functional and object-oriented language for Microsoft .NET that helps you write simple code to solve complex problems.
![Page 14: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/14.jpg)
Origin• CLR Language• Microsoft Research, Cambridge
![Page 15: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/15.jpg)
Lineage
ML OCaml F#
![Page 16: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/16.jpg)
Multi-Paradigm• Imperative• Object-oriented• Functional
![Page 17: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/17.jpg)
Licensing & Availability• First Class Citizen of Visual Studio since VS2010• Apache 2.0 License• Every major platform• Managed by F# Software Foundation
![Page 18: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/18.jpg)
Ok, but why should I care?
![Page 20: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/20.jpg)
F# Over Time
August 2011
March 2013
March 2014
Source: TIOBE Index, May 2014 (http://bit.ly/1nnmeWK)
![Page 21: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/21.jpg)
Functional-First• Favors FP over other styles• Other styles are available if needed
![Page 22: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/22.jpg)
Design Principles
![Page 23: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/23.jpg)
Terse Syntax• Few keywords• Limited punctuation• Strong type inference• Implicit return values
![Page 24: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/24.jpg)
Top-Down Evaluation• File order is significant• Declaration order is, too• Avoids inadvertent mutually recursive definitions• Inferred return values
![Page 25: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/25.jpg)
Organization Constructs• Namespaces• Modules
![Page 26: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/26.jpg)
Expression-Based• Everything returns a value• Eager evaluation
![Page 27: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/27.jpg)
Immutable by Default• 3 Types of bindings• Immutable by default
![Page 28: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/28.jpg)
Let Bindings
![Page 29: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/29.jpg)
Mutability
![Page 30: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/30.jpg)
Reference Cells
![Page 31: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/31.jpg)
Using Function & Use Bindings
![Page 32: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/32.jpg)
Type system
![Page 33: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/33.jpg)
All CLR Types• Int32• String• Double• Float• DateTime• TimeSpan• Types from other assemblies• …
![Page 34: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/34.jpg)
Enumerations
![Page 35: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/35.jpg)
Functions• Every F# function accepts exactly one input and returns
exactly one output• No concept of void functions• No concept of parameterless functions
![Page 36: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/36.jpg)
Unit• Denoted as ()• Indicates no specific value• Can safely be ignored• Usually indicative of a function that has some effect
![Page 37: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/37.jpg)
Tuples
![Page 38: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/38.jpg)
Tuples for out Parameters
![Page 39: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/39.jpg)
Syntactic Tuples
![Page 40: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/40.jpg)
Records
![Page 41: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/41.jpg)
Discriminated Unions• Immutable• Structural Equality• Resemble enumerations but are more powerful• Versatile
![Page 42: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/42.jpg)
DUs as Object Hierarchies
![Page 43: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/43.jpg)
DUs as Trees
![Page 45: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/45.jpg)
Options
![Page 46: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/46.jpg)
Integrated Units of Measure
![Page 47: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/47.jpg)
Measure Types
![Page 48: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/48.jpg)
Live Demo: Enforcing Units of Measure
![Page 49: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/49.jpg)
Collection Types• Sequences – seq { … }• Arrays – [| … |]• Lists – [ … ]• Maps• Sets
![Page 50: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/50.jpg)
Collection Modules• Provide functions for manipulating collections• Many LINQ-like operations
• map -> Select• reduce -> Aggregate• filter -> Where
![Page 51: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/51.jpg)
F# Lists• Not List<‘T>• Immutable• [ … ]• List module• Cons operator ::• Concatenation operator @
![Page 52: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/52.jpg)
Composing F# Lists With :: and @
![Page 53: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/53.jpg)
Object-Oriented
![Page 54: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/54.jpg)
Classes
![Page 55: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/55.jpg)
Filthy little hobbitses. They stole it from us!
![Page 56: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/56.jpg)
Classes
![Page 57: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/57.jpg)
Interfaces
![Page 58: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/58.jpg)
Implementing Interfaces
![Page 59: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/59.jpg)
Inheritance & Virtual Members
![Page 60: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/60.jpg)
Object Expressions
![Page 61: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/61.jpg)
Functional λ
![Page 62: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/62.jpg)
Functional programming is programming without assignment statements.
Bob Martin, FP Basics, Episode 1 (http://bit.ly/1nnhDnm)
![Page 63: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/63.jpg)
Functional Purity• F# is impure• Mutability and side-effects are
allowed
![Page 64: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/64.jpg)
Functions as Data• Higher-order functions• Let-bound functions• Lambda expressions
![Page 65: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/65.jpg)
Currying• Named for Haskell Curry• Arguments are applied individually• Changes function organization
![Page 66: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/66.jpg)
Curried Addition & Expanded Form
![Page 67: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/67.jpg)
Partial Application
![Page 68: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/68.jpg)
Pipelining
![Page 69: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/69.jpg)
Function Composition
![Page 70: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/70.jpg)
Recursion• Preferred looping mechanism• Compiler optimizes for tail calls
![Page 71: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/71.jpg)
Pattern Matching
![Page 72: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/72.jpg)
Basic Pattern Matching
![Page 73: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/73.jpg)
Built-in patterns• Null• Variable & Wildcard• Literal• Tuple• Record• Identifier
• Array• List• Cons• As• And• Or
![Page 74: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/74.jpg)
Decomposing Tuples
![Page 75: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/75.jpg)
Decomposing DUs
![Page 76: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/76.jpg)
Active Patterns• Custom patterns• Special type of function called an Active Recognizer• Curried• Maximum number of cases is 7• Each input must map to a named case
![Page 77: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/77.jpg)
Partial Active Patterns• Single custom case• Not restricted to 7 active patterns• Return value is option
![Page 78: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/78.jpg)
Live Demo: Partial Active Patterns
![Page 79: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/79.jpg)
Data Access
![Page 80: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/80.jpg)
Language Features• Query Expressions• Type Providers
![Page 81: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/81.jpg)
Live Demo: Using the OData Type Provider
![Page 82: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/82.jpg)
Async & Parallel Programming
![Page 83: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/83.jpg)
Asynchronous Workflows• Conceptually similar to async/await in C#• Works using lightweight callbacks and continuations
![Page 84: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/84.jpg)
Agent-based programming• Borrowed from Erlang• In-memory queuing mechanism• Uses MailboxProcessor<‘T> for message passing• Implementation often includes asynchronous workflows
for monitoring
![Page 85: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/85.jpg)
Live Demo: Agent-based Calculator
![Page 86: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/86.jpg)
Computation Expressions
![Page 87: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/87.jpg)
Extending the Language• Basis for several language features• Based on a builder class• Builder class methods map to familiar language
elements
![Page 88: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/88.jpg)
Live Demo: Custom Computation Expression
![Page 89: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/89.jpg)
In Summary• F# is a powerful, multi-paradigm language• Plays nicely with other CLR languages• Offers numerous constructs to keep you focused on the
problem rather than the plumbing• Simple code for complex problems
![Page 90: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/90.jpg)
No matter what language you work in, programming in a functional style provides benefits. You should do it whenever it is convenient, and you should think hard about the decision when it isn’t convenient.
John Carmack, Functional Programming in C++
![Page 91: Break Free with Managed Functional Programming: An Introduction to F#](https://reader036.fdocuments.net/reader036/viewer/2022081513/554f5a29b4c905c8088b45b6/html5/thumbnails/91.jpg)
The More You Know
• The Book of F#http://bit.ly/1hzHV6v
• F# Software Foundationhttp://fsharp.org
• Try F#http://tryfsharp.org
• F# Language Referencehttp://bit.ly/1koEoqK