• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Microsoft F# and functional programming
 

Microsoft F# and functional programming

on

  • 1,293 views

This presentation was designed to introduce you to the world of functional programming and the F# programming language from Microsoft.

This presentation was designed to introduce you to the world of functional programming and the F# programming language from Microsoft.

Statistics

Views

Total Views
1,293
Views on SlideShare
1,288
Embed Views
5

Actions

Likes
0
Downloads
13
Comments
0

2 Embeds 5

https://twitter.com 4
https://si0.twimg.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Microsoft F# and functional programming Microsoft F# and functional programming Presentation Transcript

    • and functional programming
    • Presentation Agenda1. Motivation & history2. Features of F# language3. Abilities of functional programming4. F# code examples F# and functional programming ‐ Radek Míka 2
    • What is F# About? New functional language from Microsoft Why is Microsoft investing in functional  programming?  F# and functional programming ‐ Radek Míka 3
    • What is F# About? New functional language from Microsoft Why is Microsoft investing in functional  programming?  Powerful language  Simplicity  Programmers productivity  Scalability  F# and functional programming ‐ Radek Míka 4
    • What is F# About? F# is multi‐paradigm  .NET language  Functional programming  Object oriented programming  Imperative programming  .NET ‐> built on CLI  Statically typed language F# and functional programming ‐ Radek Míka 5
    • About History Project since 2002 at Microsoft Research January 2008 – first CTP Full support in Visual Studio 2010 F# and functional programming ‐ Radek Míka 6
    • Functional Programming SAYING “WHAT” RATHER THAN “HOW”  “how”  = imperative way  “what” = declarative way (better readable) Immutability Parallel & async. programming (scalability) F# and functional programming ‐ Radek Míka 7
    • Functional Languages Expressible languages But why?  Easy testing  Scalability  Processing large sets of data  Effectiveness F#, C#, Haskel, Erlang, Scala, Lisp F# and functional programming ‐ Radek Míka 8
    • Code//F# //C#open System using System;let a = 2 namespace ConsoleApplication1Console.WriteLine a { class Program { static int a() { return 2; } static void Main(string[] args) { Console.WriteLine(a); } More Noise  } Than Signal! } F# and functional programming ‐ Radek Míka 9
    • F# Pleasure C# Pain abstract class Commandtype Command = Command of (Rover ‐> unit) { public virtual void Execute(); }let BreakCommand =  abstract class MarsRoverCommand : Command Command(fun rover ‐> rover.Accelerate(‐1.0)) { protected MarsRover Rover { get; privlet TurnLeftCommand =  Command(fun rover ‐> rover.Rotate(‐5.0<degs>)) public MarsRoverCommand(MarsRover rov { this.Rover = rover; } } class BreakCommand : MarsRoverCommand { public BreakCommand(MarsRover rover) : base(rover) { } public override void Execute() { Rover.Rotate(‐5.0); } } class TurnLeftCommand : MarsRoverCommand {… F# and functional programming ‐ Radek Míka 10
    • Summary F# is multi‐paradigm language, mainly functional  Powerful  Flexible syntax  Shorter & elegant code  Increase productivity  Parallel & async. programming = extremely easy F# and functional programming ‐ Radek Míka 11
    • Sources http://www.fsharp.net• Real World Functional Programming  • Programming F# (Chris Smith) (Tomas Petricek, John Skeet) F# and functional programming ‐ Radek Míka 12
    • Questions F# and functional programming ‐ Radek Míka 13
    • The End Radek Míka radek@radekmika.cz