Your SlideShare is downloading. ×
Microsoft F# and functional programming
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

Microsoft F# and functional programming

1,105
views

Published on

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.

Published in: Technology

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

  • Be the first to like this

No Downloads
Views
Total Views
1,105
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
13
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. and functional programming
  • 2. Presentation Agenda1. Motivation & history2. Features of F# language3. Abilities of functional programming4. F# code examples F# and functional programming ‐ Radek Míka 2
  • 3. What is F# About? New functional language from Microsoft Why is Microsoft investing in functional  programming?  F# and functional programming ‐ Radek Míka 3
  • 4. 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
  • 5. 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
  • 6. 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
  • 7. 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
  • 8. 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
  • 9. 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
  • 10. 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
  • 11. 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
  • 12. 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
  • 13. Questions F# and functional programming ‐ Radek Míka 13
  • 14. The End Radek Míka radek@radekmika.cz

×