Sign in to turn on 1-Click ordering.
Trade in Yours
For a 7.00 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Sorry, this item is not available in
Image not available for
Image not available

Tell the Publisher!
Id like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Real-World Functional Programming: With Examples in F# and C# [Paperback]

Tomas Petricek , Jon Skeet
5.0 out of 5 stars  See all reviews (4 customer reviews)
RRP: 31.99
Price: 25.59 & FREE Delivery in the UK. Details
You Save: 6.40 (20%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
Only 2 left in stock (more on the way).
Dispatched from and sold by Amazon. Gift-wrap available.
Want it tomorrow, 4 Sept.? Choose Express delivery at checkout. Details
Trade In this Item for up to 7.00
Trade in Real-World Functional Programming: With Examples in F# and C# for an Amazon Gift Card of up to 7.00, which you can then spend on millions of items across the site. Trade-in values may vary (terms apply). Learn more

Book Description

25 Jan 2010 1933988924 978-1933988924 1

Functional programming languages like F#, Erlang, and Scala are attracting attention as an efficient way to handle the new requirements for programming multi-processor and high-availability applications. Microsoft's new F# is a true functional language and C# uses functional language features for LINQ and other recent advances.

Real-World Functional Programming is a unique tutorial that explores the functional programming model through the F# and C# languages. The clearly presented ideas and examples teach readers how functional programming differs from other approaches. It explains how ideas look in F#-a functional language-as well as how they can be successfully used to solve programming problems in C#. Readers build on what they know about .NET and learn where a functional approach makes the most sense and how to apply it effectively in those cases.

The reader should have a good working knowledge of C#. No prior exposure to F# or functional programming is required.

Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.

Frequently Bought Together

Real-World Functional Programming: With Examples in F# and C# + Programming F# 3.0 + Expert F# 3.0 (Expert's Voice in F#)
Price For All Three: 110.22

Buy the selected items together

Product details

  • Paperback: 500 pages
  • Publisher: Manning Publications; 1 edition (25 Jan 2010)
  • Language: English
  • ISBN-10: 1933988924
  • ISBN-13: 978-1933988924
  • Product Dimensions: 19.1 x 23.5 cm
  • Average Customer Review: 5.0 out of 5 stars  See all reviews (4 customer reviews)
  • Amazon Bestsellers Rank: 210,328 in Books (See Top 100 in Books)

More About the Authors

Discover books, learn about writers, and more.

Product Description

About the Author

Tomas Petricek

discovered functional programming as a graduate student at

Charles University in Prague. He has been a Microsoft C# MVP since 2004 and

is one of the most active members in the F# community. In addition to his work

with F#, he has been using C# 3.0 in a functional way since the early previews in

2005. He interned with the F# team at Microsoft Research, and he has developed

a client/server web framework for F# called F# WebTools. His articles on functional

programming in .NET and various other topics can be found at his web site


Inside This Book (Learn More)
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index | Back Cover
Search inside this book:

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

What Other Items Do Customers Buy After Viewing This Item?

Customer Reviews

4 star
3 star
2 star
1 star
5.0 out of 5 stars
5.0 out of 5 stars
Most Helpful Customer Reviews
9 of 9 people found the following review helpful
5.0 out of 5 stars Functionally perfect 13 Oct 2010
Format:Paperback|Verified Purchase
There are not many technical programming books that could also be decribed as page-turners but this is definitely one of them: everything about it is perfection. Real-world Functional Programming is exceptionally well-written and well backed-up by a wealth of on-line supporting material; the author, Tomas Petricek, himself is readily accessible online and very much a leading contributor to the most popular functional programming fora.
This is best described as a functional programming course rather than a reference book and it is structured accordingly; the four parts: "Learning to think functionally", "Fundamental functional techniques", "Advanced F# programming techniques" and "Applied functional programming" provide a very thorough basis for becoming a functional programming professional. I think this book is mainly aimed at people taking their first tentative steps into the functional programming world - probably from an imperative language like C#. The first part is a gentle but thorough exploration of the functional programming paradigm and how it differs (immutability, compositionality) from imperative languages. Functional language concepts are the ideal solution to a number of programming tasks and we see how many functional concepts are finding their way increasingly into imperative languages (LINQ, Lambdas in C# for example).
Read more ›
Comment | 
Was this review helpful to you?
3 of 3 people found the following review helpful
5.0 out of 5 stars Great book for a C# programmer. 29 Mar 2011
Format:Paperback|Verified Purchase
As it states in his "About this book", "This is not a quick guide to F# programming", this should probably not the first book on F# to read. But this book is perfect for a C# programmer who wants to make a move to F#. It lets you gradually think in the functional way of doing programming with many F# and comparable C# example code. Only downside (but for that I cannot give this book a star less): if you want to try the F# examples you have to be aware of the way F# handles whitespace. I also purchased Programming F# where this topic is well explained.
Comment | 
Was this review helpful to you?
1 of 1 people found the following review helpful
5.0 out of 5 stars A great introduction to the language 15 Dec 2012
Having struggled to understand the new F# concepts (e.g. discriminated unions, the pipe operator, pattern matching) in the past, I have found this book to be invaluable. The author's C#-based approach (that is, explaining the confusing F# features in terms of how they would look in C#) meant that I had very little difficulty getting to grips with it. I can say with conviction that this is the most useful F# reference I have yet found, either online or offline. If you're familiar with VB.NET or C#, and want to try F#, get this book. Anyone with a .NET background should have no problem following along.

Incidentally, when I first discovered F#, I thought "what's the point? Functional languages are for maths professors and nobody else, and it's not even properly object-oriented". I was wrong, it's actually a very powerful language. When will VB.NET support discriminated unions; and deconstructing anonymous tuples returned from a function call? Probably never.
Comment | 
Was this review helpful to you?
2 of 3 people found the following review helpful
5.0 out of 5 stars excellent 11 Oct 2010
Format:Paperback|Verified Purchase
This book is superb for introducing functional programming and doing so in a way that helps imperative programmers grasp the (many) functional concepts they need to know. Also an excellent F# reference. Looks of good, practical examples.
Comment | 
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 4.1 out of 5 stars  19 reviews
24 of 24 people found the following review helpful
5.0 out of 5 stars a pragmatic approach to F#, especially for C# programmers 4 April 2010
By Andre M. Van Meulebrouck - Published on Amazon.com
Format:Paperback|Verified Purchase
A hallmark of this book is a very pragmatic, Rosetta stone approach to F#.

Since F# lives in .Net, and .Net is inherently object-oriented; it makes sense to understand something of the mapping that takes place behind the scenes when F# code is mapped into the .Net world.

Many of the interesting new features introduced into C# are actually hand-me-downs from FP (functional programming). This includes generics, LINQ, anonymous methods, lambdas, type inference, etc.. Since many programmers need to use C# in the work-a-day world, it makes sense to understand the functional elements of C# by seeing them in a functional language like F#, where they can be seen in their purest (least hobbled) state. Once these concepts are understood, it is then much easier to understand how to wield these tools effectively in C#.

That said, there are also limits to how much functional programming can be done in C# (and how effectively it can be accomplished). This book clearly demarcates the boundaries of what is (and isn't) feasible in C# vis-à-vis functional programming.

One of the things I liked best about this book is the discussion on why functional programming makes code easier to read, write, and verify. This discussion does not appeal to what might be (for many) inaccessible theory (i.e. denotational semantics, category theory, etc.). Instead it is demonstrated in amazingly simple, straightforward ways! This discussion is very effective.

Another facet of this book's approach that I applaud is the demonstration of lambda calculus. Why would a practical book dabble in theory? There's actually a very pragmatic payoff in doing this: functional programming has a lot of underpinnings in lambda calculus. Those that have been exposed to lambda calculus will feel right at home in F#. Those that haven't are likely to feel more "culture shock" when being exposed to concepts like currying and lazy evaluation. Functional programming really does represent a substantially different way of thinking about computation.

This book also features an excellent discussion about design patterns; comparing and contrasting how they are implemented in OOP (object-oriented programming) versus FP. Some classic design patterns in OOP essentially come for free in FP (e.g. the "visitor" pattern).
12 of 13 people found the following review helpful
5.0 out of 5 stars Excellent tutorial with a unique approach 12 Jan 2010
By anonymous - Published on Amazon.com
Format:Paperback|Verified Purchase
I usually don't like tutorial-style books, but am finding this one invaluable. More than the other F# titles to date, it explores at length what makes functional programming different, and what this means in a .NET context. A unique feature is the running comparison of F# with both traditional and "functional style" C#. Code listings are nicely labeled with arrows pointing out important details. The book is not intended as a language reference, and only lightly touches on the imperative and object-oriented sides of F#, or contents of standard .NET libraries, but this allows a more leisurely and thorough treatment of the distinctively functional concepts and their implications for program design. Highly recommended.
13 of 15 people found the following review helpful
5.0 out of 5 stars Good Book. 5 Jan 2010
By Andrei Mouravski - Published on Amazon.com
Functional Programming for the Real World, by Tomas Petricek and Jon Skeet,
introduces the functional programming paradigm by comparison to more traditional
imperative programming techniques. The first part of the book goes through many
common programming tasks and compares how you would implement them in the C#
programming language and then re-introduces the problem from a functional
perspective using F#. It introduces simple ideas such as recursion and how to
use recursion to simulate many iterative constructs to the idea of higher-order functions, all the while keeping the explanations and examples very clear. The
author also strives to instill good functional design practices in the reader by
introducing different ways to think of functional programs and common design
patterns that can assist in clean implementations.

The second half of the book dives into more advanced functional concepts, such
as lazy evaluation, efficiency, and continuations. It also takes a look at
using functional programming for practical tasks. Overall, this section is more
suited towards someone who understood the majority of the first half of the book, or to someone who is already familiar with functional concepts.

I would recommend this book to newcomers and intermediate programmers who are
looking to learn about or refine their functional programming skills. The
authors do a good job of covering the core material and also introduce a good
amount of advanced material towards the end of the book.
8 of 9 people found the following review helpful
4.0 out of 5 stars In-depth exploration of F#, but not very focused or practical 31 Mar 2012
By Shashikant Penumarthy - Published on Amazon.com
As an experienced programmer that has encountered functional concepts before in Javascript, Ruby or Python, I found this book slow and impractical. However, if you never took a Comp Sci class using a functional language and are now looking to fill that gap, or if you are looking to get a deep understanding of F#'s design rationale, you'll love it.

I am an experienced programmer in C#, Java, Python and Javascript and I bought this book to get started with F#. I am writing this review because I promised to write one in return for a free copy of this book, which I got via a book review program where I work. I worked through the examples in the book using Visual Studio and experimented with variations of the examples to understand things better, so you could say I studied the content well. I picked this book over other F# books only because I had read Jon Skeet's *outstanding* C# in Depth cover to cover and expected the same level of quality and detail.

The book definitely delivers on both fronts. There is a solid discussion of F# syntax, what it does, how it supports a functional way of thinking and how you can improve C# code to benefit from these ideas. I will be re-reading and experimenting with variations of examples in this book for months. In other words, you get a *lot* for your money.

I found this book a little strange and difficult to read for the following reasons:
1) It explains functional programming concepts as if the reader is completely new to it. I found myself skimming through lots of text that I felt was obvious from the F# code snippet.
2) It spends way too much time talking about applying functional thinking to C# code. I found this unnecessary because F# and C# are different tools for different applications - I'll use F# when I think a functional approach is right. A couple of lines of text that describe roughly what one would have had to do in C# to achieve the same effect (plus perhaps C# snippets in an appendix) would have been sufficient.
3) The flow of the book wasn't right for me because I like to get the syntax out of the way before tackling everything else. A small chapter at the beginning that offered a "crash course on F# syntax" would have greatly improved the book for me.

But I don't think that is the kind of book the authors set out to write.

This book won't get you up to speed with F# quickly. The examples aren't from the real world. You cannot use this as a reference book. Strictly speaking, it's not even a book about functional programming.

This is a book about functional *thinking*, written for those who know your typical C, C++, Java or PHP. A better title for this book might have been "Functional Thinking for OOP/Imperative Programmers: From C# to F#". It is a functional programming book for those who haven't taken a CS class using a functional language.

If you are looking for a book that will help you add F# to your language toolset, this is not it. But if you're the type that often writes a line of code and wonders why the language looks the way it does, it doesn't get any better. This is a timeless book that I will refer to whenever I write a line of F# and wonder: "why does it do that?"
6 of 6 people found the following review helpful
4.0 out of 5 stars Great book for understanding the rationale behind F# 20 Feb 2011
By Amazon Customer - Published on Amazon.com
I agree with other reviewers that this book is great in getting you through the ins and outs of why things are done the way they are in F#. I have not read the entire book, but so far my impressions are that it does a better job at explaining "why" than Expert F#, which is Don Syme's book.

On the other hand, this book should not be your first F# book, even if you know C#, which the authors draw parallels to throughout and very successfully. The reason for this is that often times you can't follow exactly the examples in the book to get snippet of code runnning. This forces you to go and find other sources to complement the sample code in the book to get it to run and solidify your understanding on the topic. You may like or dislike this.

As a first book I like beginning F#, which is indeed a great companion to this book as in this one, you can actually follow the samples in the book and almost always get running code. Plus Beginning F# has great merit on its own. I will do a review on this book soon.

Beyond that, there are other books which complement this one very well, a few of them are:

* F# Wikibook at [...]. This is a great book by awesome princess.
* Professional F# 2.0: I have not read this one entirely, but what I read I liked.
* Programming in Erlang: This one by Joe Armstrong is not F#, but Erlang shares a lot in common with F# in areas like tuples, list comprehensions, pattern matching and the message passing model. So even if it is not F#, reading this one will give you "portable" knowledge on the concepts mentioned.
* Expert F#: Don Syme's book, nuff said.
Were these reviews helpful?   Let us know
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
First post:
Prompts for sign-in

Search Customer Discussions
Search all Amazon discussions

Look for similar items by category