E-Book, Englisch, 448 Seiten
Pickering Beginning F#
1. ed
ISBN: 978-1-4302-2390-0
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
E-Book, Englisch, 448 Seiten
ISBN: 978-1-4302-2390-0
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
Functional programming is perhaps the next big wave in application development. As experienced developers know, functional programming makes its mark by allowing application builders to develop solutions to complicated programming situations cleanly and efficiently. A rich history of functional languages, including Erlang and OCaml, leads the way to F#, Microsoft's effort to bring the elegance and focus of functional programming into the world of managed code and .NET. With Beginning F#, you have a companion that that will help you explore F# and functional programming in a .NET environment. This book is both a comprehensive introduction to all aspects of the language and an incisive guide to using F# for real-world professional development. Reviewed by Don Syme, the chief architect of F# at Microsoft Research, Beginning F# is a great foundation for exploring functional programming and its role in the future of application development.
Robert Pickering is an extraordinarily prolific writer on F#. The F# Wiki on his website, Strangelights.com, is among the most popular F# web sites in the world. He is a consultant for LexiFi, lives in France, and works on projects in England, Denmark, Holland, and Belgium. He received his bachelor of science degree in computer science from Manchester University in 1999.
Autoren/Hrsg.
Weitere Infos & Material
1;Title Page;1
2;Copyright Page;2
3;Contents at a Glance;4
4;Table of Contents ;5
5;Foreword;12
6;About the Author;14
7;About the Technical Reviewer;15
8;Acknowledgments;16
9;Preface;17
10;Chapter 1 Introduction;18
10.1;What Is Functional Programming?;18
10.2;Why Is Functional Programming Important?;19
10.3;What Is F#?;19
10.4;Who Is Using F#?;20
10.5;Who Is This Book For?;21
10.6;What’s Next?;21
11;Chapter 2 How to, Obtain, Install, and Use F#;23
11.1;Obtaining F#;23
11.2;Installing F# on Windows with Visual Studio 2008;24
11.3;Installing F# on Linux;24
11.4;Using F# in Different Ways;26
11.4.1;Visual Studio;26
11.4.2;SharpDevelop;27
11.4.3;F# Interactive Command-Line;28
11.5;The Examples in this Book;29
11.6;Summary;30
12;Chapter 3 Functional Programming;31
12.1;Literals;31
12.2;Functions;33
12.3;Identifiers and let Bindings;34
12.3.1;Identifier Names;35
12.3.2;Scope;36
12.3.3;Capturing Identifiers;40
12.3.4;The use Binding;41
12.4;Recursion;42
12.5;Operators;43
12.6;Function Application;44
12.7;Partial Application of Functions;46
12.8;Pattern Matching;47
12.9;Control Flow;51
12.10;Lists;52
12.10.1;Pattern Matching Against Lists;54
12.10.2;List Comprehensions;56
12.11;Types and Type Inference;59
12.12;Defining Types;61
12.12.1;Tuple and Record Types;61
12.12.2;Union or Sum Types;65
12.12.3;Type Definitions with Type Parameters;67
12.12.4;Recursive Type Definitions;69
12.13;Active Patterns;70
12.13.1;Complete Active Patterns;70
12.13.2;Incomplete Active Patterns;71
12.14;Units of Measure;73
12.15;Exceptions and Exception Handling;74
12.16;Lazy Evaluation;76
12.17;Summary;79
13;Chapter 4 Imperative Programming;80
13.1;The unit Type;80
13.2;The mutable Keyword;82
13.3;Defining Mutable Record Types;84
13.4;The ref Type;86
13.5;Arrays;88
13.6;Array Comprehensions;91
13.7;Control Flow;92
13.8;Calling Static Methods and Properties from .NET Libraries;95
13.9;Using Objects and Instance Members from .NET Libraries;97
13.10;Using Indexers from .NET Libraries;99
13.11;Working with Events from .NET Libraries;100
13.12;Pattern Matching over .NET Types;103
13.13;The |> Operator;105
13.14;Summary;107
14;Chapter 5 Object-Oriented Programming;108
14.1;Records As Objects;109
14.2;F# Types with Members;112
14.3;Object Expressions;115
14.4;Defining Classes;120
14.5;Optional Parameters;123
14.6;Defining Interfaces;124
14.7;Implementing Interfaces;125
14.8;Classes and Inheritance;127
14.9;Methods and Inheritance;128
14.10;Accessing the Base Class;129
14.11;Properties and Indexers;130
14.12;Overriding Methods from Non-F# Libraries;133
14.13;Abstract Classes;133
14.14;Classes and Static Methods;134
14.15;Classes with Explicit Fields and Constructors;135
14.16;Casting;136
14.17;Type Tests;138
14.18;Type Annotations for Subtyping;138
14.19;Defining Delegates;140
14.20;Structs;141
14.21;Enums;141
14.22;Summary;142
15;Chapter 6 Organizing, Annotating, and Quoting Code;143
15.1;Modules;143
15.2;Namespaces;145
15.3;Opening Namespaces and Modules;146
15.4;Giving Modules Aliases;149
15.5;Signature Files;149
15.6;Private and Internal let Bindings and Members;150
15.7;Module Scope;151
15.8;Module Execution;152
15.9;Optional Compilation;154
15.10;Comments;156
15.11;Doc Comments;156
15.12;Comments for Cross Compilation;158
15.13;Custom Attributes;159
15.14;Quoted Code;161
15.15;Summary;165
16;Chapter 7 The F# Libraries;166
16.1;The Native F# Library FSharp.Core.dll;166
16.1.1;The Microsoft.FSharp.Core.Operators Module;167
16.2;Arithmetic Operators;167
16.3;Floating-Point Arithmetic Functions;168
16.4;Tuple Functions;170
16.5;The Conversion Functions;170
16.6;The Logical Or and And Operators;171
16.6.1;The Microsoft.FSharp.Reflection Module;171
16.7;Reflection Over Types;171
16.8;Reflection Over Values;172
16.8.1;The Microsoft.FSharp.Collections.Seq Module;173
16.9;The map and iter Functions;174
16.10;The concat Function;175
16.11;The fold Function;175
16.12;The exists and forall Functions;176
16.13;The filter, find, and tryFind Functions;176
16.14;The choose Function;177
16.15;The init and initInfinite Functions;178
16.16;The unfold Function;179
16.17;The generate Function;180
16.18;The cast Function;181
16.18.1;The Microsoft.FSharp.Text.Printf Module;182
16.18.2;The Microsoft.FSharp.Control.Event Module;185
16.19;Creating and Handling Events;185
16.20;The filter Function;186
16.21;The partition Function;186
16.22;The map Function;187
16.23;The Power Pack Library FSharp.PowerPack.dll;187
16.23.1;The Microsoft.FSharp.Math Namespace;188
16.24;Summary;191
17;Chapter 8 User Interfaces;192
17.1;Introducing WinForms;192
17.2;Drawing WinForms;193
17.3;Working with Controls in WinForms;201
17.4;Using the Visual Studio Form Designer’s Forms in F#;206
17.5;Working with WinForms Events and the Event Module;209
17.6;Creating New Forms Classes;213
17.7;Introducing Windows Presentation Foundation;215
17.8;Introducing Windows Presentation Foundation 3D;217
17.9;Introducing GTK#;228
17.10;Introducing ASP.NET;230
17.11;Creating an IHttpHandler;231
17.12;Working with ASP.NET Web Forms;234
17.13;Summary;238
18;Chapter 9 Data Access;239
18.1;The System.Configuration Namespace;239
18.2;The System.IO Namespace;242
18.3;Using Sequences with System.IO;244
18.4;The System.Xml Namespace;246
18.5;ADO.NET;249
18.6;Data Binding;255
18.7;Data Binding and the DataGridView Control;257
18.8;ADO.NET Extensions;261
18.9;Introducing LINQ;266
18.10;Using LINQ to XML;267
18.11;Summary;270
19;Chapter 10 Parallel Programming;271
19.1;Threads, Memory, Locking and Blocking;272
19.2;Reactive Programming;275
19.3;Data Parallelism;281
19.4;Asynchronous Programming;288
19.5;Message Passing;292
19.6;Summary;301
20;Chapter 11 Distributed Applications;302
20.1;Networking Overview;302
20.2;Using TCP/IP Sockets;304
20.3;Using HTTP;314
20.4;Using HTTP with Google Spreadsheets;316
20.5;Using HTTP Posts;319
20.6;Using HTTP Asynchronously;320
20.7;Creating Web Services;323
20.8;Windows Communication Foundation;328
20.9;Hosting WCF Services;332
20.10;Summary;337
21;Chapter 12 Language-Oriented Programming;338
21.1;What Is Language-Oriented Programming?;338
21.2;Data Structures as Little Languages;338
21.2.1;A Data Structure–Based Language Implementation;340
21.3;Metaprogramming with Quotations;347
21.4;Implementing a Compiler and an Interpreter for an Arithmetic-Language;349
21.4.1;The Abstract Syntax Tree;350
21.4.2;Interpreting the AST;350
21.4.3;Compiling the AST;352
21.4.4;Compilation vs. Interpretation;356
21.5;Summary;360
22;Chapter 13 Parsing Text;361
22.1;Parsing CSV Format;361
22.2;Language Definition for the Other Examples;364
22.3;Using fslex.exe and fsyacc.exe;364
22.3.1;Tokenizing the Text: Fslex;365
22.3.2;Generating a Parser: Fsyacc;367
22.3.3;Using the Parser;369
22.4;FParsec Library;371
22.5;Summary;379
23;Chapter 14 Compatibility and Advanced Interoperation;380
23.1;Calling F# Libraries from C#;380
23.1.1;Returning Tuples;381
23.1.2;Exposing Functions That Take Functions As Parameters;383
23.1.3;Using Union Types;385
23.1.4;Using F# Lists;389
23.1.5;Defining Types in a Namespace;390
23.1.6;Defining Classes and Interfaces;392
23.2;Calling Using COM Objects;394
23.3;Using COM Style APIs;396
23.4;Using P/Invoke;397
23.5;Using Inline IL;400
23.6;Using F# from Native Code via COM;401
23.7;Hosting the CLR;404
23.8;Summary;406
24;Index;407




