Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Functional Programming          - Introducing F#                     06/15/2012
Example Give me a list of numbers from 1 to 100.    Tell me how ?             Tell me what ?
What?Functional programming is a programming paradigmthat treats computation as the evaluation ofmathematical functions an...
Why? Succinct & simpler programs   Small code base, low dev/maintenance cost. A number of powerful new ways to structur...
How? Immutability Type Inference Recursion High Order Functions Partial Application Pattern Matching Unit of Measure
ImmutabilityBy default, values are immutable. Use keywordmutable to mark it as mutable.
Type Inference F# can deduce data types automatically. Type annotation is necessary in certain case.
Recursion• Functional programming prefers recursion to  imperative for-each loops.• Prefer tail recursion to avoid stack o...
High order Function Functions in F#
High order Function Functions as First Class Member Functions that accept a function as a parameter or returns a function
High Order Function Map Fold Zip Filter Pipeline Function Composition Partial Application
Pattern Match Compare data with a logical structure Decompose data into its constituent parts Extract information from ...
Unit of Measure Floating point and signed integer values in F# can  have associated units of measure. Compile time check...
Functional Programming in Real World Erlang developed in Ericsson widely used in T-  Mobile, Facebook.... Industry   Co...
Resources The F# Survival Guide Functional Programming for the Real World
Functional programming   f#
Upcoming SlideShare
Loading in …5
×

Functional programming f#

436 views

Published on

Introducing functional programming basic concepts via F#.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Functional programming f#

  1. 1. Functional Programming - Introducing F# 06/15/2012
  2. 2. Example Give me a list of numbers from 1 to 100. Tell me how ? Tell me what ?
  3. 3. What?Functional programming is a programming paradigmthat treats computation as the evaluation ofmathematical functions and avoids state and mutabledata. y = f (x)A function is a transformation. It transforms one or more inputs into exactlyone output.
  4. 4. Why? Succinct & simpler programs  Small code base, low dev/maintenance cost. A number of powerful new ways to structure and reason about programs.  Immutability  High order function  Pattern Matching …
  5. 5. How? Immutability Type Inference Recursion High Order Functions Partial Application Pattern Matching Unit of Measure
  6. 6. ImmutabilityBy default, values are immutable. Use keywordmutable to mark it as mutable.
  7. 7. Type Inference F# can deduce data types automatically. Type annotation is necessary in certain case.
  8. 8. Recursion• Functional programming prefers recursion to imperative for-each loops.• Prefer tail recursion to avoid stack overflow
  9. 9. High order Function Functions in F#
  10. 10. High order Function Functions as First Class Member Functions that accept a function as a parameter or returns a function
  11. 11. High Order Function Map Fold Zip Filter Pipeline Function Composition Partial Application
  12. 12. Pattern Match Compare data with a logical structure Decompose data into its constituent parts Extract information from constructs in various ways
  13. 13. Unit of Measure Floating point and signed integer values in F# can have associated units of measure. Compile time checking.
  14. 14. Functional Programming in Real World Erlang developed in Ericsson widely used in T- Mobile, Facebook.... Industry  Communication  Finance industry  Scientific computation  AI Languages support FP  Haskell  Scala  Python  Clojure  …
  15. 15. Resources The F# Survival Guide Functional Programming for the Real World

×