About the Authors |
|
xxiii | |
About the Technical Reviewers |
|
xxv | |
Acknowledgments |
|
xxvii | |
|
|
1 | (6) |
|
|
2 | (1) |
|
|
2 | (3) |
|
|
5 | (2) |
|
Chapter 2 Your First F# Program: Getting Started with F# |
|
|
7 | (22) |
|
Creating Your First F# Program |
|
|
7 | (2) |
|
|
9 | (1) |
|
|
9 | (1) |
|
|
10 | (2) |
|
|
12 | (1) |
|
|
12 | (1) |
|
|
13 | (1) |
|
|
14 | (1) |
|
Using Properties and the Dot-Notation |
|
|
15 | (1) |
|
|
16 | (2) |
|
|
18 | (1) |
|
Using Object-Oriented Libraries from F# |
|
|
19 | (1) |
|
Using open to Access Namespaces and Modules |
|
|
20 | (1) |
|
|
21 | (2) |
|
Getting and Using Packages |
|
|
23 | (1) |
|
Accessing External Data Using F# Packages |
|
|
24 | (1) |
|
Starting a Web Server and Serving Data using F# Packages |
|
|
25 | (2) |
|
|
27 | (2) |
|
Chapter 3 Introducing Functional Programming |
|
|
29 | (26) |
|
Starting with Numbers and Strings |
|
|
29 | (1) |
|
Some Simple Types and Literals |
|
|
29 | (2) |
|
|
31 | (1) |
|
|
31 | (1) |
|
|
31 | (1) |
|
Working with Conditionals: && and II |
|
|
32 | (1) |
|
Defining Recursive Functions |
|
|
33 | (1) |
|
|
34 | (4) |
|
|
38 | (1) |
|
Getting Started with Pattern Matching |
|
|
39 | (1) |
|
Matching on Structured Values |
|
|
40 | (1) |
|
Guarding Rules and Combining Patterns |
|
|
41 | (1) |
|
Further Ways of Forming Patterns |
|
|
42 | (1) |
|
Introducing Function Values |
|
|
43 | (1) |
|
|
44 | (1) |
|
Computing with Collection Functions |
|
|
44 | (1) |
|
Using Fluent Notation on Collections |
|
|
45 | (1) |
|
Composing Functions with >> |
|
|
46 | (1) |
|
Building Functions with Partial Application |
|
|
47 | (1) |
|
|
48 | (1) |
|
|
49 | (1) |
|
Abstracting Control with Functions |
|
|
50 | (1) |
|
Using Object Methods as First-Class Functions |
|
|
51 | (1) |
|
Some Common Uses of Function Values |
|
|
51 | (2) |
|
|
53 | (2) |
|
Chapter 4 Introducing Imperative Programming |
|
|
55 | (34) |
|
About Functional and Imperative Programming |
|
|
55 | (1) |
|
Imperative Looping and Iterating |
|
|
56 | (1) |
|
|
56 | (1) |
|
|
57 | (1) |
|
More Iteration Loops over Sequences |
|
|
57 | (1) |
|
|
58 | (1) |
|
|
59 | (1) |
|
Using Mutable let Bindings |
|
|
60 | (1) |
|
|
61 | (1) |
|
|
62 | (2) |
|
Generating and Slicing Arrays |
|
|
64 | (1) |
|
|
65 | (1) |
|
Introducing the Imperative .NET Collections |
|
|
65 | (1) |
|
|
65 | (1) |
|
|
66 | (1) |
|
Using Dictionary's TryGetValue |
|
|
67 | (1) |
|
Using Dictionaries with Compound Keys |
|
|
68 | (1) |
|
Some Other Mutable Data Structures |
|
|
69 | (1) |
|
Exceptions and Controlling Them |
|
|
69 | (2) |
|
|
71 | (1) |
|
|
72 | (1) |
|
Defining New Exception Types |
|
|
72 | (1) |
|
Having an Effect: Basic I/O |
|
|
73 | (1) |
|
|
74 | (2) |
|
Some Other I/O-Related Types |
|
|
76 | (1) |
|
|
76 | (1) |
|
Combining Functional and Imperative Efficient Precomputation and Caching |
|
|
76 | (1) |
|
Precomputation and Partial Application |
|
|
77 | (1) |
|
Precomputation and Objects |
|
|
78 | (1) |
|
|
79 | (3) |
|
|
82 | (1) |
|
Other Variations on Caching and Memoization |
|
|
83 | (1) |
|
|
83 | (1) |
|
Combining Functional and Imperative: Functional Programming with Side Effects |
|
|
84 | (1) |
|
Consider Replacing Mutable Locals and Loops with Recursion |
|
|
84 | (1) |
|
Separating Pure Computation from Side-Effecting Computations |
|
|
85 | (1) |
|
Separating Mutable Data Structures |
|
|
85 | (1) |
|
Not All Side Effects Are Equal |
|
|
86 | (1) |
|
Avoid Combining Imperative Programming and Laziness |
|
|
87 | (1) |
|
|
88 | (1) |
|
Chapter 5 Understanding Types in Functional Programming |
|
|
89 | (32) |
|
Exploring Some Simple Type Definitions |
|
|
89 | (1) |
|
Defining Type Abbreviations |
|
|
89 | (1) |
|
|
90 | (1) |
|
Handling Non-Unique Record Field Names |
|
|
91 | (1) |
|
|
92 | (1) |
|
Defining Discriminated Unions |
|
|
92 | (2) |
|
Using Discriminated Unions as Records |
|
|
94 | (1) |
|
Defining Multiple Types Simultaneously |
|
|
95 | (1) |
|
|
95 | (1) |
|
Writing Generic Functions |
|
|
96 | (1) |
|
Some Important Generic Functions |
|
|
97 | (6) |
|
|
103 | (1) |
|
Generic Algorithms through Explicit Arguments |
|
|
103 | (1) |
|
Generic Algorithms through Function Parameters |
|
|
104 | (2) |
|
Generic Algorithms through Inlining |
|
|
106 | (2) |
|
More on Different Kinds of Types |
|
|
108 | (1) |
|
Reference Types and Value Types |
|
|
108 | (1) |
|
Other Flavors of .NET Types |
|
|
109 | (1) |
|
|
109 | (1) |
|
|
110 | (1) |
|
|
110 | (1) |
|
Performing Type Tests via Pattern Matching |
|
|
111 | (1) |
|
Knowing When Upcasts Are Applied Automatically |
|
|
111 | (2) |
|
|
113 | (1) |
|
Troubleshooting Type-Inference Problems |
|
|
114 | (1) |
|
Using a Visual Editing Environment |
|
|
114 | (1) |
|
|
114 | (1) |
|
Understanding the Value Restriction |
|
|
115 | (1) |
|
Working Around the Value Restriction |
|
|
116 | (2) |
|
Understanding Generic Overloaded Operators |
|
|
118 | (1) |
|
|
119 | (2) |
|
Chapter 6 Programming with Objects |
|
|
121 | (40) |
|
Getting Started with Objects and Members |
|
|
121 | (4) |
|
|
125 | (3) |
|
Adding Further Object Notation to Your Types |
|
|
128 | (1) |
|
Working with Indexer Properties |
|
|
128 | (1) |
|
Adding Overloaded Operators |
|
|
129 | (1) |
|
Using Named and Optional Arguments |
|
|
130 | (2) |
|
Adding Method Overloading |
|
|
132 | (1) |
|
Defining Object Types with Mutable State |
|
|
133 | (2) |
|
Using Optional Property Settings |
|
|
135 | (1) |
|
Declaring Auto-Properties |
|
|
136 | (1) |
|
Getting Started with Object Interface Types |
|
|
136 | (2) |
|
Defining New Object Interface Types |
|
|
138 | (1) |
|
Implementing Object Interface Types Using Object Expressions |
|
|
138 | (2) |
|
Implementing Object Interface Types Using Concrete Types |
|
|
140 | (1) |
|
Using Common Object Interface Types from the .NET Libraries |
|
|
141 | (1) |
|
Understanding Hierarchies of Object Interface Types |
|
|
142 | (1) |
|
More Techniques for Implementing Objects |
|
|
142 | (1) |
|
Combining Object Expressions and Function Parameters |
|
|
142 | (2) |
|
Defining Partially Implemented Class Types |
|
|
144 | (1) |
|
Using Partially Implemented Types via Delegation |
|
|
145 | (1) |
|
Using Partially Implemented Types via Implementation Inheritance |
|
|
145 | (2) |
|
Combining Functional and Objects: Cleaning Up Resources |
|
|
147 | (1) |
|
Resources and IDisposable |
|
|
147 | (3) |
|
Managing Resources with More-Complex Lifetimes |
|
|
150 | (1) |
|
Cleaning Up Internal Objects |
|
|
150 | (1) |
|
Cleaning Up Unmanaged Objects |
|
|
151 | (2) |
|
Extending Existing Types and Modules |
|
|
153 | (3) |
|
Working with F# Objects and .NET Types |
|
|
156 | (1) |
|
|
157 | (1) |
|
|
158 | (1) |
|
|
158 | (1) |
|
|
159 | (1) |
|
|
160 | (1) |
|
Chapter 7 Encapsulating and Organizing Your Code |
|
|
161 | (20) |
|
|
161 | (1) |
|
Hiding Things with Local Definitions |
|
|
162 | (2) |
|
Hiding Things with Accessibility Annotations |
|
|
164 | (3) |
|
Organizing Code with Namespaces and Modules |
|
|
167 | (1) |
|
Putting Your Code in a Module |
|
|
167 | (1) |
|
Putting Your Modules and Types in Namespaces |
|
|
168 | (1) |
|
Defining a Module with the Same Name as a Type |
|
|
169 | (1) |
|
Preventing Client Code from Opening a Module |
|
|
169 | (1) |
|
|
170 | (1) |
|
Automatically Opening Modules |
|
|
170 | (1) |
|
Projects, Assemblies, and Compilation Order |
|
|
171 | (1) |
|
Creating Assemblies, DLLs, and EXEs |
|
|
171 | (3) |
|
Project Files and Compilation Order |
|
|
174 | (2) |
|
|
176 | (2) |
|
Designing with Signatures |
|
|
178 | (1) |
|
When Are Signature Types Checked? |
|
|
178 | (1) |
|
|
178 | (1) |
|
Using Files as Small Reusable Components |
|
|
178 | (1) |
|
Creating and Sharing Packages |
|
|
179 | (1) |
|
|
179 | (2) |
|
Chapter 8 Working with Textual Data |
|
|
181 | (32) |
|
Building Strings and Formatting Data |
|
|
181 | (1) |
|
|
181 | (1) |
|
More about String Literals |
|
|
182 | (1) |
|
|
183 | (2) |
|
Generic Structural Formatting |
|
|
185 | (1) |
|
Formatting Strings Using .NET Formatting |
|
|
185 | (1) |
|
Parsing Strings and Textual Data |
|
|
186 | (1) |
|
|
186 | (1) |
|
Processing Line-Based Input |
|
|
187 | (1) |
|
Using Regular Expressions |
|
|
188 | (1) |
|
More on Matching with System.Text.RegularExpressions |
|
|
189 | (4) |
|
More Robust Code with the Regular Expression Type Provider |
|
|
193 | (1) |
|
Using XML as a Concrete Language Format |
|
|
194 | (1) |
|
Using the System.Xml Namespace |
|
|
195 | (2) |
|
From Concrete XML to Abstract Syntax |
|
|
197 | (2) |
|
Using the FSharp.Data XmlTypeProvider |
|
|
199 | (3) |
|
Using JSON as a Concrete Language Format |
|
|
202 | (1) |
|
|
202 | (1) |
|
Using the FSharp.Data JsonProvider |
|
|
203 | (2) |
|
Some Recursive Descent Parsing |
|
|
205 | (1) |
|
|
205 | (1) |
|
Recursive-Descent Parsing |
|
|
206 | (2) |
|
Binary Parsing and Formatting |
|
|
208 | (3) |
|
Encoding and Decoding Unicode Strings |
|
|
211 | (1) |
|
Encoding and Decoding Binary Data |
|
|
212 | (1) |
|
|
212 | (1) |
|
Chapter 9 Working with Sequences and Tree-Structured Data |
|
|
213 | (44) |
|
Getting Started with Sequences |
|
|
213 | (1) |
|
|
214 | (1) |
|
|
215 | (1) |
|
Transforming Sequences with Functions |
|
|
215 | (1) |
|
Which Types Can Be Used as Sequences? |
|
|
216 | (1) |
|
Using Lazy Sequences from External Sources |
|
|
217 | (1) |
|
Using Sequence Expressions |
|
|
218 | (1) |
|
Enriching Sequence Expressions with Additional Logic |
|
|
219 | (1) |
|
Generating Lists and Arrays Using Sequence Expressions |
|
|
220 | (1) |
|
More on Working with Sequences |
|
|
220 | (1) |
|
Using Other Sequence Operators: Truncate and Sort |
|
|
221 | (1) |
|
Selecting Multiple Elements from Sequences |
|
|
222 | (2) |
|
Finding Elements and Indexes in Sequences |
|
|
224 | (1) |
|
Grouping and Indexing Sequences |
|
|
224 | (1) |
|
|
225 | (2) |
|
Cleaning Up in Sequence Expressions |
|
|
227 | (1) |
|
Expressing Operations Using Sequence Expressions |
|
|
227 | (1) |
|
Structure beyond Sequences: Domain Modeling |
|
|
228 | (2) |
|
Transforming Domain Models |
|
|
230 | (1) |
|
Using On-Demand Computation with Domain Models |
|
|
231 | (2) |
|
Caching Properties in Domain Models |
|
|
233 | (1) |
|
Memoizing Construction of Domain Model Nodes |
|
|
234 | (2) |
|
Active Patterns: Views for Structured Data |
|
|
236 | (1) |
|
Converting the Same Data to Many Views |
|
|
236 | (2) |
|
Matching on .NET Object Types |
|
|
238 | (1) |
|
Defining Partial and Parameterized Active Patterns |
|
|
239 | (1) |
|
Hiding Representations with Active Patterns |
|
|
240 | (2) |
|
Equality, Hashing, and Comparison |
|
|
242 | (1) |
|
Asserting Equality, Hashing, and Comparison Using Attributes |
|
|
243 | (1) |
|
Fully Customizing Equality, Hashing, and Comparison on a Type |
|
|
244 | (2) |
|
Suppressing Equality, Hashing, and Comparison on a Type |
|
|
246 | (1) |
|
Customizing Generic Collection Types |
|
|
246 | (1) |
|
Tail Calls and Recursive Programming |
|
|
247 | (1) |
|
Tail Recursion and List Processing |
|
|
248 | (2) |
|
Tail Recursion and Object-Oriented Programming |
|
|
250 | (1) |
|
Tail Recursion and Processing Unbalanced Trees |
|
|
251 | (1) |
|
Using Continuations to Avoid Stack Overflows |
|
|
252 | (2) |
|
Another Example: Processing Syntax Trees |
|
|
254 | (1) |
|
|
255 | (2) |
|
Chapter 10 Numeric Programming and Charting |
|
|
257 | (28) |
|
Getting Started with FsLab |
|
|
257 | (1) |
|
Basic Charting with FSharp.Charting |
|
|
258 | (1) |
|
Basic Numeric Types and Literals |
|
|
259 | (1) |
|
|
260 | (1) |
|
|
261 | (1) |
|
|
261 | (1) |
|
|
262 | (1) |
|
Overloaded Math Functions |
|
|
262 | (1) |
|
|
262 | (1) |
|
Sequences, Statistics, and Numeric Code |
|
|
263 | (1) |
|
Summing, Averaging, Maximizing, and Minimizing Sequences |
|
|
263 | (3) |
|
Counting and Categorizing |
|
|
266 | (1) |
|
Writing Fresh Numeric Code |
|
|
266 | (2) |
|
Making Numeric Code Generic |
|
|
268 | (1) |
|
|
269 | (2) |
|
Statistics, Linear Algebra, and Distributions with Math.NET |
|
|
271 | (1) |
|
Basic Statistical Functions in Math.NET Numerics |
|
|
272 | (1) |
|
Using Histograms and Distributions from Math.NET Numerics |
|
|
273 | (1) |
|
Using Matrices and Vectors from Math.NET |
|
|
274 | (1) |
|
Matrix Inverses, Decomposition, and Eigenvalues |
|
|
275 | (1) |
|
Time Series and Data Frames with Deedle |
|
|
276 | (3) |
|
|
279 | (1) |
|
Adding Units to a Numeric Algorithms |
|
|
280 | (2) |
|
Adding Units to a Type Definition |
|
|
282 | (1) |
|
Applying and Removing Units |
|
|
283 | (1) |
|
Some Limitations of Units of Measure |
|
|
283 | (1) |
|
|
284 | (1) |
|
Chapter 11 Reactive, Asynchronous, and Parallel Programming |
|
|
285 | (32) |
|
|
286 | (1) |
|
|
287 | (1) |
|
Creating and Publishing Events |
|
|
288 | (1) |
|
Events as First-Class Values |
|
|
289 | (1) |
|
From Events to Observables |
|
|
290 | (1) |
|
Asynchronous Computations |
|
|
290 | (1) |
|
Fetching Multiple Web Pages in Parallel, Asynchronously |
|
|
290 | (2) |
|
Understanding Asynchronous Computations |
|
|
292 | (3) |
|
Example: Parallel File Processing Using Async Computations |
|
|
295 | (3) |
|
Running Async Computations |
|
|
298 | (1) |
|
Common I/O Operations in Asynchronous Computations |
|
|
298 | (1) |
|
Understanding Exceptions and Cancellations |
|
|
299 | (1) |
|
Interoperating with .NET Tasks |
|
|
300 | (1) |
|
|
301 | (1) |
|
|
301 | (2) |
|
Creating Objects That React to Messages |
|
|
303 | (2) |
|
Scanning Mailboxes for Relevant Messages |
|
|
305 | (1) |
|
Example: An Asynchronous Agent for Web Crawling |
|
|
306 | (3) |
|
Example: Using async for CPU Parallelism |
|
|
309 | (1) |
|
Under the Hood: Implementing Async.Parallel |
|
|
310 | (1) |
|
Using Shared-Memory Concurrency |
|
|
310 | (1) |
|
Creating Threads Explicitly |
|
|
311 | (1) |
|
Creating Tasks Explicitly |
|
|
311 | (1) |
|
Shared Memory, Race Conditions, and the .NET Memory Model |
|
|
312 | (1) |
|
Using Locks to Avoid Race Conditions |
|
|
313 | (1) |
|
|
314 | (1) |
|
Some Other Concurrency Primitives |
|
|
314 | (1) |
|
|
315 | (2) |
|
Chapter 12 Symbolic Programming with Structured Data |
|
|
317 | (28) |
|
Verifying Circuits with Propositional Logic |
|
|
317 | (1) |
|
Representing Propositional Logic |
|
|
318 | (2) |
|
Evaluating Propositional Logic Naively |
|
|
320 | (2) |
|
From Circuits to Propositional Logic |
|
|
322 | (4) |
|
Checking Simple Properties of Circuits |
|
|
326 | (1) |
|
Representing Propositional Formulae Efficiently Using BDDs |
|
|
326 | (4) |
|
Circuit Verification with BDDs |
|
|
330 | (2) |
|
Expression Simplification and Differentiation |
|
|
332 | (2) |
|
Implementing Local Simplifications |
|
|
334 | (1) |
|
A Richer Language of Algebraic Expressions |
|
|
335 | (1) |
|
Parsing Algebraic Expressions |
|
|
336 | (3) |
|
Simplifying Algebraic Expressions |
|
|
339 | (2) |
|
Symbolic Differentiation of Algebraic Expressions |
|
|
341 | (1) |
|
|
342 | (1) |
|
|
343 | (1) |
|
|
344 | (1) |
|
Chapter 13 Integrating External Data and Services |
|
|
345 | (18) |
|
|
346 | (1) |
|
Getting Data in JSON Format |
|
|
347 | (1) |
|
Parsing and Handling Multiple Pages |
|
|
348 | (1) |
|
Getting Started with Queries |
|
|
349 | (1) |
|
Example: Language-Integrated SQL |
|
|
350 | (2) |
|
|
352 | (1) |
|
|
352 | (1) |
|
|
353 | (1) |
|
|
353 | (1) |
|
|
354 | (1) |
|
|
354 | (1) |
|
|
355 | (2) |
|
Directly Embedding T-SQL Using SqICommandProvider |
|
|
357 | (1) |
|
Raw Access to Databases Using ADO.NET |
|
|
357 | (1) |
|
Establishing Connections Using ADO.NET |
|
|
358 | (1) |
|
Creating a Database Using ADO.NET |
|
|
359 | (1) |
|
Creating Tables Using ADO.NET |
|
|
359 | (2) |
|
Using Stored Procedures via ADO.NET |
|
|
361 | (1) |
|
|
362 | (1) |
|
Chapter 14 Building Smart Web Applications |
|
|
363 | (54) |
|
Serving Web Content Directly |
|
|
363 | (6) |
|
Rich Client Web Applications with WebSharper |
|
|
369 | (1) |
|
Getting Started with WebSharper |
|
|
370 | (3) |
|
Pagelets - Working with Reactive HTML and Client-Side Code |
|
|
373 | (6) |
|
|
379 | (4) |
|
|
383 | (12) |
|
Developing REST Applications |
|
|
395 | (6) |
|
Formlets and Piglets: Building Functional Web Forms |
|
|
401 | (11) |
|
Automated Resource Tracking and Handling |
|
|
412 | (1) |
|
Using Third-Party JavaScript Libraries |
|
|
413 | (1) |
|
Working with .NET Proxies |
|
|
414 | (1) |
|
|
415 | (2) |
|
Chapter 15 Visualization and Graphical User Interfaces |
|
|
417 | (48) |
|
|
417 | (1) |
|
Writing "Hello, World!" in a Click |
|
|
418 | (1) |
|
Understanding the Anatomy of a Graphical Application |
|
|
419 | (1) |
|
Composing Controls and Menus |
|
|
420 | (3) |
|
Composing User Interfaces |
|
|
423 | (3) |
|
|
426 | (5) |
|
Creating a Mandelbrot Viewer |
|
|
431 | (1) |
|
|
432 | (1) |
|
|
433 | (3) |
|
Creating the Visualization Application |
|
|
436 | (2) |
|
Creating the Application Plumbing |
|
|
438 | (6) |
|
Writing Your Own Controls |
|
|
444 | (1) |
|
Developing a Custom Control |
|
|
444 | (2) |
|
|
446 | (2) |
|
The World, the View, and Coordinate Systems |
|
|
448 | (1) |
|
|
448 | (5) |
|
World and View Coordinates |
|
|
453 | (4) |
|
|
457 | (7) |
|
|
464 | (1) |
|
Chapter 16 Language-Oriented Programming |
|
|
465 | (30) |
|
|
466 | (2) |
|
An Example: Success/Failure Computation Expressions |
|
|
468 | (3) |
|
Defining a Computation-Expression Builder |
|
|
471 | (3) |
|
Computation Expressions and Untamed Side Effects |
|
|
474 | (1) |
|
Computation Expressions with Custom Query Operators |
|
|
475 | (1) |
|
Example: Probabilistic Computations |
|
|
476 | (4) |
|
Combining Computation Expressions and Resources |
|
|
480 | (1) |
|
Recursive Workflow Expressions |
|
|
481 | (1) |
|
|
481 | (1) |
|
|
481 | (1) |
|
Schema Compilation by Reflecting on Types |
|
|
482 | (3) |
|
Using the F# Dynamic Reflection Operators |
|
|
485 | (1) |
|
|
486 | (1) |
|
Example: Using F# Quotations for Error Estimation |
|
|
487 | (2) |
|
Resolving Reflected Definitions |
|
|
489 | (1) |
|
Writing an F# Type Provider |
|
|
490 | (3) |
|
|
493 | (2) |
|
Chapter 17 Libraries and Interoperability |
|
|
495 | (24) |
|
Types, Memory, and Interoperability |
|
|
495 | (1) |
|
Libraries: A High-Level Overview |
|
|
496 | (1) |
|
Namespaces from the .NET Framework |
|
|
497 | (1) |
|
Namespaces from FSharp.Core and FSharp.Data Libraries |
|
|
498 | (1) |
|
Some F# Community Libraries |
|
|
499 | (1) |
|
|
499 | (1) |
|
Using Further F# and .NET Data Structures |
|
|
500 | (1) |
|
System.Collections.Generic and Other .NET Collections |
|
|
501 | (1) |
|
Supervising and Isolating Execution |
|
|
502 | (1) |
|
Further Libraries for Reflective Techniques |
|
|
502 | (1) |
|
|
502 | (1) |
|
|
503 | (1) |
|
Some Other .NET Types You May Encounter |
|
|
503 | (1) |
|
Some F# Community Type Providers |
|
|
504 | (1) |
|
Under the Hood: Interoperating with C# and Other .NET Languages |
|
|
505 | (2) |
|
Memory Management at Runtime |
|
|
507 | (1) |
|
Interoperating with C and C++ with Plnvoke |
|
|
508 | (1) |
|
Getting Started with Plnvoke |
|
|
509 | (2) |
|
Mapping C Data Structures to F# Code |
|
|
511 | (1) |
|
Marshalling Parameters to and from C |
|
|
512 | (2) |
|
Marshalling Strings to and from C |
|
|
514 | (2) |
|
Passing Function Pointers to C |
|
|
516 | (1) |
|
Wrapper Generation and the Limits of Plnvoke |
|
|
517 | (1) |
|
|
518 | (1) |
|
Chapter 18 Developing and Testing F# Code |
|
|
519 | (22) |
|
|
519 | (1) |
|
|
520 | (1) |
|
Mixing Scripting and Compiled Code |
|
|
520 | (1) |
|
Choosing Optimization Settings |
|
|
521 | (1) |
|
|
521 | (1) |
|
|
522 | (1) |
|
|
523 | (1) |
|
Packaging Different Kinds of Code |
|
|
523 | (1) |
|
|
524 | (1) |
|
Using Data and Configuration Settings |
|
|
524 | (1) |
|
Using F# Interactive Effectively |
|
|
525 | (1) |
|
Controlling F# Interactive |
|
|
526 | (1) |
|
Some Common F# Interactive Directives |
|
|
527 | (1) |
|
Understanding How F# Interactive Compiles Code |
|
|
527 | (1) |
|
Using Tracing Diagnostics |
|
|
528 | (3) |
|
Debugging Your Code with an IDE |
|
|
531 | (2) |
|
Debugging Across Multiple Languages |
|
|
533 | (1) |
|
Debugging Concurrent Applications |
|
|
534 | (1) |
|
|
535 | (2) |
|
Using Test Fixtures in NUnit/XUnit |
|
|
537 | (2) |
|
Combining NUnit/XUnit and F# Interactive Debugging |
|
|
539 | (1) |
|
Property-based Testing Using FsCheck |
|
|
539 | (1) |
|
|
540 | (1) |
|
Chapter 19 Designing F# Libraries |
|
|
541 | (18) |
|
Designing Vanilla .NET Libraries |
|
|
542 | (4) |
|
Understanding Functional-Design Methodology |
|
|
546 | (1) |
|
Understanding Where Functional Programming Comes From |
|
|
546 | (2) |
|
Understanding Functional-Design Methodology |
|
|
548 | (1) |
|
Applying the Good Library Design to F# |
|
|
549 | (1) |
|
Recommendation: Use Correct Naming and Capitalization Conventions Where Possible |
|
|
549 | (3) |
|
Recommendation: Avoid Using Underscores in Names |
|
|
552 | (1) |
|
Recommendation: Follow the Recommended Guidelines for Exceptions |
|
|
552 | (1) |
|
Recommendation: Consider Using Option Values for Return Types Instead of Raising Exceptions |
|
|
553 | (1) |
|
Recommendation: Follow the Recommended Guidelines for Value Types |
|
|
553 | (1) |
|
Recommendation: Consider Using Explicit Signature Files for Your Framework |
|
|
553 | (1) |
|
Recommendation: Consider Avoiding the Use of Implementation Inheritance for Extensibility |
|
|
553 | (1) |
|
Recommendation: Use Properties and Methods for Attributes and Operations Essential to a Type |
|
|
554 | (1) |
|
Recommendation: Avoid Revealing Concrete Data Representations Such as Records |
|
|
554 | (1) |
|
Recommendation: Use Active Patterns to Hide the Implementations of Discriminated Unions |
|
|
554 | (1) |
|
Recommendation: Use Object-Interface Types Instead of Tuples or Records of Functions |
|
|
555 | (1) |
|
Recommendation: Understand When Currying Is Useful in Functional Programming APIs |
|
|
555 | (1) |
|
Recommendation: Use Tuples for Return Values, Arguments, and Intermediate Values |
|
|
556 | (1) |
|
Recommendation: Use Async for Asynchronous Computations |
|
|
556 | (1) |
|
Recommendation: Use Choice or a Named Type for Alternative Results |
|
|
556 | (1) |
|
Some Recommended Coding Idioms |
|
|
556 | (1) |
|
Recommendation: Use the Standard Operators |
|
|
557 | (1) |
|
Recommendation: Place the Pipeline Operator | > at the Start of a Line |
|
|
557 | (1) |
|
Recommendation: Format Object Expressions Using the member Syntax |
|
|
557 | (1) |
|
|
558 | (1) |
|
Appendix F# Brief Language Guide |
|
|
559 | (8) |
|
|
559 | (1) |
|
|
559 | (1) |
|
|
560 | (1) |
|
|
560 | (1) |
|
Functions, Composition, and Pipelining |
|
|
560 | (1) |
|
|
561 | (1) |
|
|
561 | (1) |
|
Tuples, Arrays, Lists, and Collections |
|
|
562 | (1) |
|
|
563 | (1) |
|
Type Definitions and Objects |
|
|
564 | (1) |
|
|
565 | (1) |
|
Sequence Expressions and Workflows |
|
|
565 | (1) |
|
|
566 | (1) |
Index |
|
567 | |