Your SlideShare is downloading. ×
Fsharp shdh 40 lightning talk
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Fsharp shdh 40 lightning talk

510
views

Published on

A 5 minute lightning talk given at SHDH 40 on F#.

A 5 minute lightning talk given at SHDH 40 on F#.


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
510
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Some F# Highlights
    Matt Harrington
    mbh.work@gmail.com
  • 2. Dealing With Concurrency
    Hire an expert, or …
    Software Transactional Memory, or …
    Functional Programming.
    -Unknown
  • 3. Free, as in beer
    Free standalone compiler for .NET (Windows or Mono).
    Syntax highlighting for TextMate, vim, emacs, TextPad, jedit, and others.
    IDEs:
    MonoDevelop
    SharpDevelop
    Visual Studio Shell
    Microsoft Research Shared Source License
  • 4. Robin Milner
    University of Edinburgh
    ML – 1970s
    Don Syme
    MSR Cambridge
    F# - 2002
    Xavier Leroy, et al.
    INRIA, France
    Ocaml - 1996
  • 5.
  • 6. FP
    First class functions
    Immutability
    Recursion
    Type inference
    Pattern matching
    Lists, sequences, tuples, records, discriminated unions
    Optiontype
  • 12. OO
    Classes
    Inheritance
    Interfaces
    Structs
    Properties
    Delegates
    Enums
    Mutability
  • 13. Tail Call Optimization
    .method public static int32 g(int32 x) cil managed
    {
    .maxstack 5
    L_0000: nop
    L_0001: ldarg.0
    L_0002: ldc.i4.0
    L_0003: ble.s L_0007
    L_0005: br.s L_0009
    L_0007: br.s L_0019
    L_0009: newobj instance void Program/g@9::.ctor()
    L_000e: ldarg.0
    L_000f: ldc.i4.1
    L_0010: sub
    L_0011: tail
    L_0013: call int32 Program::f(class [FSharp.Core]Microsoft.<snip>)
    L_0018: ret
    L_0019: ldarg.0
    L_001a: ret
    }
  • 14. Units of Measure
    [<Measure>]
    type kilogram
    letbowlingBall = 7.26<kilogram>
    let force (mass: float<kilogram>) = mass * 9.8
  • 15. Pipeline operator
    let numbers = [1 .. 100]
    let square x = x * x
    letsumOfSquares =
    numbers |> List.mapsquare
    |> List.sum
  • 16. Euler Problem #7
    let isPrimenum =
    letupperDivisor = int32(sqrt(float num))
    matchnumwith
    | 0 | 1 -> false
    | 2 -> true
    | n ->seq { 2 .. upperDivisor } |>
    Seq.forall(fun x ->num % x <> 0)
    let primes = Seq.initInfinite id |> Seq.filterisPrime
    let nthPrime n = Seq.nth n primes
    printfn "The 10001st prime number is %i."
    (nthPrime 10001)
    Code from "Juliet" on StackOverflow.
  • 17. More…
    Matt Harrington: mbh.work@gmail.com
    SFsharp.org
    Luca Bolognese’s video (see links on SFsharp.org)
    Programming F# by Chris Smith