Real-worldFunctionalProgrammingwithexamplesinc#andf#
C#与F#编程实践(manning Real-world Functional Programming with examples in c# and f#),函数式编程入门书籍Real-worldFunctional programmingReal-worldFunctional programmingWITH EXAMPLES IN F# AND C#TOMAS PETRICEKwith JON SKEETMANNINGGreenwich(74 w long.For online information and ordering of this and other Manning books, please visitwww.manning.com.ThepublisheroffersdiscountsonthisbookwhenorderedinquantityFor more information, please contactSpecial sales DepartmentManning publications coSoundⅤ iew Court3BGreenwich. cT06830Email:orders@manning.com@2010 by Manning Publications Co. All rights reservedNo part of this publication may be reproduced, stored in a retrieval system, or transmitted, inany form or by means electronic, mechanical, photocopying, or otherwise, without prior writtenpermission of the publisher.Many of the designations used by manufacturers and sellers to distinguish their products areclaimed as trademarks. Where those designations appear in the book, and manningPublications was aware of a trademark claim, the designations have been printed in initial capsllo Recognizing the importance of preserving what has been written, it is Mannings policy to havethe books we publish printed on acid-free paper, and we exert our best efforts to that endRecognizing also our responsibility to conserve the resources of our planet, Manning books areprinted on paper that is at least 1 5 %o recycled and processed without the use of elemental chlorineDevelopment editor: Tara WalshManning publications coCopyeditor: Liz WelchSoundⅤ iew Court3BTypesetter: Gordan salinovicGreenwich, CT06830Cover designer: Leslie haimesISBN978-1933988-924Printed in the United states of america12345678910-MAL-141312111009brief contentsPART 1 LEARNING TO THINK FUNCTIONALLYI Thinking differently 32 Core concepts in functional programming 293Meet tuples, lists, and functions in F# and C# 544 Exploring f# and net libraries by example 8PART 2 FUNDAMENTAL FUNCTIONAL TECHNIQUES1055 Using functional values locally 107Processing values using higher-order functions 1427 Designing data-centric programs 177Designing behavior-centric programs 205PART 3 ADVANCED F# PROGRAMMING TECHNIQUES2319 Turning values into f# object types with members 23310 Efficiency of data structures 26011 Refactoring and testing functional programs 28512 Sequence expressions and alternative workflows 314PART 4 APPLIED FUNCTIONAL PROGRAMMING ...5.....35118 Asynchronous and data-driven programming 353Writing parallel functional programs 38815 Creating composable functional libraries 42016 Developing reactive functional programs 460contentsforeword xviipreface xixacknowledgments xxiabout this book xxivabout the cover illustration xxxPART 1 LEARNING TO THINK FUNCTIONALLY..Thinking differently 31 What is functional programming41. 2 The path to real-world functional programming 6Functional languages 6. Functional programming on the. NET1.3 Being productive with functional programming 7The functional paradigm 7. Declarative programming style 8Understanding what a program does 9. Concurrency-friendlyapplication design 10: How functional style shapes your code 111.4 Functional programming by example 12Expressing intentions using declarative style 13. Understanding codeusing immutability 17. writing efficient parallel programs 20CONTENTS1.5 Introducing F# 21Hello world in F# 22. From simplicity to the real world 241.6 Summary 27Core concepts in functional programmingg292.1 The foundation of functional programming 312.2 Evaluation of functional programs 32Working with immutable values 33. Using immutable datastructures 33- Changing program state using recursion 34Using expressions instead of statements 35. Computation bcalculation 372.3 Writing declarative code 39Functions as values 39. Higher-order functions 412.4 Functional types and values 45Type inference in Ct and F 46. Introducing the discriminatedunion type 47- Pattern matching 48. Compile-time programchecking 512.5 Summary 52Meet tuples, lists, and functions in F and C# 543.1 Value and function declarations 55Value declarations and scope 55. Function declarations 57Declaring mutable values 598.2 Using immutable data structures 60Introducing tuple type 60. Implementing a tuple type in Ct 63Calculating with tuples 64 a Pattern matching with tuples 663.3 Lists and recursion 68Recursive computations 68 Introducing functional lists 69Functional lists in C# 72. Functional list processing 743.4 USing functions as values 75Processing lists of numbers 76. Benefits ofparameterizedfunctions 793.5 Summary 79Exploring Ft and. NET libraries by example 814.1 Drawing pie charts in F# 824.2 Writing and testing code in Fsi 83Loading and parsing data 83. Calculating with the data 86
用户评论