Book description
Expert F# 2.0 is about practical programming in a beautiful language that puts the power and elegance of functional programming into the hands of professional developers. In combination with .NET, F# achieves unrivaled levels of programmer productivity and program clarity.
Expert F# 2.0 is
The authoritative guide to F# by the inventor of F#
A comprehensive reference of F# concepts, syntax, and features
A treasury of expert F# techniques for practical, real-world programming
F# isn't just another functional programming language. It's a general-purpose language ideal for real-world development. F# seamlessly integrates functional, imperative, and object-oriented programming styles so you can flexibly and elegantly solve any programming problem. Whatever your background, you'll find that F# is easy to learn, fun to use, and extraordinarily powerful. F# will change the way you think about—and go about—programming.
Written by F#'s inventor and two major contributors to its development, Expert F# 2.0 is the authoritative, comprehensive, and in-depth guide to the language and its use. Designed to help others become experts, the first part of the book quickly yet carefully describes the F# language. The second part then shows how to use F# elegantly for a wide variety of practical programming tasks.
The world's foremost experts in F# show you how to program in F# the way they do!
Table of contents
- Copyright
- Foreword
- About the Authors
- About the Technical Reviewer
- Acknowledgments
- 1. Introduction
- 2. Getting Started with F# and .NET
-
3. Creating Your First F# Program—Introducing Functional Programming
- 3.1. Getting Started with F# Arithmetic
- 3.2. Introducing Simple Strings
- 3.3. Working with Lists and Options
- 3.4. Defining Recursive Functions
-
3.5. Introducing Function Values
- 3.5.1. Using Anonymous Function Values
- 3.5.2. Computing with Aggregate Operators
- 3.5.3. Composing Functions with >>
- 3.5.4. Building Functions with Partial Application
- 3.5.5. Using Local Functions
- 3.5.6. Using Functions as Abstract Values
- 3.5.7. Iterating with Aggregate Operators
- 3.5.8. Abstracting Control with Functions
- 3.5.9. Using .NET Methods as First-Class Functions
- 3.6. Getting Started with Pattern Matching
- 3.7. Getting Started with Sequences
- 3.8. Using Sequence Expressions
- 3.9. Exploring Some Simple Type Definitions
- 3.10. Summary
-
4. Introducing Imperative Programming
- 4.1. Imperative Looping and Iterating
- 4.2. Using Mutable Records
- 4.3. Using Mutable Locals
- 4.4. Working with Arrays
- 4.5. Introducing the Imperative .NET Collections
- 4.6. Exceptions and Controlling Them
- 4.7. Having an Effect: Basic I/O
- 4.8. Working with null Values
- 4.9. Some Advice: Functional Programming with Side Effects
- 4.10. Summary
-
5. Mastering Types and Generics
- 5.1. Understanding Generic Type Variables
- 5.2. Writing Generic Functions
- 5.3. Understanding Some Important Generic Functions
- 5.4. Making Things Generic
- 5.5. Understanding .NET Types
- 5.6. Understanding Subtyping
- 5.7. Units of Measure
- 5.8. Troubleshooting Type-Inference Problems
- 5.9. Summary
-
6. Working with Objects and Modules
- 6.1. Getting Started with Objects and Members
- 6.2. Using Classes
- 6.3. Adding Further Object Notation to Your Types
- 6.4. Defining Object Types with Mutable State
-
6.5. Getting Started with Object Interface Types
- 6.5.1. Defining New Object Interface Types
- 6.5.2. Implementing Object Interface Types Using Object Expressions
- 6.5.3. Implementing Object Interface Types Using Concrete Types
- 6.5.4. Using Common Object Interface Types from the .NET Libraries
- 6.5.5. Understanding Hierarchies of Object Interface Types
- 6.6. More Techniques to Implement Objects
- 6.7. Using Modules and Static Members
- 6.8. Extending Existing Types and Modules
- 6.9. Working with F# Objects and .NET Types
- 6.10. Summary
- 7. Encapsulating and Packaging Your Code
- 8. Mastering F#: Common Techniques
-
9. Introducing Language-Oriented Programming
- 9.1. Using XML as a Concrete Language Format
-
9.2. Working with Abstract Syntax Representations
- 9.2.1. Abstract Syntax Representations: Less Is More
- 9.2.2. Processing Abstract Syntax Representations
- 9.2.3. Transformational Traversals of Abstract Syntax Representations
- 9.2.4. Using On-Demand Computation with Abstract Syntax Trees
- 9.2.5. Caching Properties in Abstract Syntax Trees
- 9.2.6. Memoizing Construction of Syntax Tree Nodes
- 9.3. Introducing Active Patterns
- 9.4. Embedded Computational Languages with Workflows
- 9.5. Using F# Reflection
- 9.6. Using F# Quotations
- 9.7. Summary
-
10. Using the F# and .NET Libraries
- 10.1. A High-Level Overview
- 10.2. Using the System Types
- 10.3. Using Regular Expressions and Formatting
- 10.4. Using Further F# and .NET Data Structures
- 10.5. Introducing Microsoft.FSharp.Math
- 10.6. Supervising and Isolating Execution
- 10.7. Further Libraries for Reflective Techniques
- 10.8. Some Other .NET Types You May Encounter
- 10.9. Some Other .NET Libraries
- 10.10. Summary
-
11. Building Graphical User Interfaces
- 11.1. Writing "Hello, World!" in a Click
- 11.2. Understanding the Anatomy of a Graphical Application
- 11.3. Composing User Interfaces
- 11.4. Drawing Applications
- 11.5. Writing Your Own Controls
- 11.6. Displaying Samples from Sensors
- 11.7. Creating a Mandelbrot Viewer
- 11.8. Windows Presentation Foundation
- 11.9. Summary
-
12. Working with Symbolic Representations
-
12.1. Symbolic Differentiation and Expression Rendering
- 12.1.1. Modeling Simple Algebraic Expressions
- 12.1.2. Implementing Local Simplifications
- 12.1.3. A Richer Language of Algebraic Expressions
- 12.1.4. Parsing Algebraic Expressions
- 12.1.5. Simplifying Algebraic Expressions
- 12.1.6. Symbolic Differentiation of Algebraic Expressions
- 12.1.7. Rendering Expressions
- 12.1.8. Building the User Interface
- 12.2. Verifying Circuits with Propositional Logic
- 12.3. Summary
-
12.1. Symbolic Differentiation and Expression Rendering
-
13. Reactive, Asynchronous, and Parallel Programming
- 13.1. Introducing Some Terminology
- 13.2. Using and Designing Background Workers
-
13.3. Introducing Asynchronous and Parallel Computations
- 13.3.1. Fetching Multiple Web Pages in Parallel, Asynchronously
- 13.3.2. Understanding Thread Hopping
- 13.3.3. Under the Hood: What Are Asynchronous Computations?
- 13.3.4. Parallel File Processing Using Asynchronous Workflows
- 13.3.5. Running Asynchronous Computations
- 13.3.6. Common I/O Operations in Asynchronous Workflows
- 13.3.7. Under the Hood: Implementing Async.Parallel
- 13.3.8. Using async for CPU Parallelism with Fixed Tasks
- 13.3.9. Understanding Exceptions and Cancellation
- 13.4. Passing and Processing Messages
- 13.5. Using Shared-Memory Concurrency
- 13.6. Summary
-
14. Building Smart Web Applications
- 14.1. Serving Static Web Content
- 14.2. Serving Dynamic Web Content with ASP.NET
- 14.3. Using ASP.NET Input Controls
- 14.4. Displaying Data from Databases
- 14.5. Going Further with ASP.NET
- 14.6. Building Ajax Rich Client Applications
- 14.7. WebSharper Formlets
- 14.8. Using WSDL Web Services
- 14.9. Summary
-
15. Working with Data
- 15.1. Querying In-Memory Data Structures
-
15.2. Using Databases to Manage Data
- 15.2.1. Choosing Your Database Engine
- 15.2.2. Understanding ADO.NET
- 15.2.3. Establishing Connections to a Database Engine
- 15.2.4. Creating a Database
- 15.2.5. Creating Tables and Inserting and Fetching Records
- 15.2.6. Using Untyped Datasets
- 15.2.7. Generating Typed Datasets Using xsd.exe
- 15.2.8. Using Stored Procedures
- 15.2.9. Using Data Grids
- 15.3. Working with Databases in Visual Studio
- 15.4. Accessing Relational Data with Linq Queries
- 15.5. Working with XML as a Generic Data Format
- 15.6. Summary
- 16. Lexing and Parsing
- 17. Interoperating with C and COM
- 18. Debugging and Testing F# Programs
-
19. Designing F# Libraries
- 19.1. Designing Vanilla .NET Libraries
- 19.2. Understanding Functional Design Methodology
-
19.3. Applying the .NET Library Design Guidelines to F#
-
19.3.1.
-
19.3.1.1.
- 19.3.1.1.1. Recommendation: Use the .NET Naming and Capitalization Conventions Where Possible
- 19.3.1.1.2. Recommendation: Avoid Using Underscores in Names
- 19.3.1.1.3. Recommendation: Follow the .NET Guidelines for Exceptions
- 19.3.1.1.4. Recommendation: Consider Using Option Values for Return Types Instead of Raising Exceptions
- 19.3.1.1.5. Recommendation: Follow the .NET Guidelines for Value Types
- 19.3.1.1.6. Recommendation: Consider Using Explicit Signature Files for Your Framework
- 19.3.1.1.7. Recommendation: Consider Avoiding the Use of Implementation Inheritance for Extensibility
- 19.3.1.1.8. Recommendation: Use Properties and Methods for Attributes and Operations Essential to a Type
- 19.3.1.1.9. Recommendation: Avoid Revealing Concrete Data Representations Such as Records
- 19.3.1.1.10. Recommendation: Use Active Patterns to Hide the Implementations of Discriminated Unions
- 19.3.1.1.11. Recommendation: Use Object Interface Types Instead of Tuples or Records of Functions
- 19.3.1.1.12. Recommendation: Understand When Currying Is Useful in Functional Programming APIs
- 19.3.1.1.13. Recommendation: Use Tuples for Return Values, Arguments, and Intermediate Values
-
19.3.1.1.
-
19.3.1.
- 19.4. Some Recommended Coding Idioms
- 19.5. Summary
-
A. F# Brief Language Guide
- A.1. Comments and Attributes
- A.2. Basic Types and Literals
- A.3. Types
- A.4. Patterns and Matching
- A.5. Functions, Composition, and Pipelining
- A.6. Binding and Control Flow
- A.7. Exceptions
- A.8. Tuples, Arrays, Lists, and Collections
- A.9. Operators
- A.10. Type Definitions and Objects
- A.11. Namespaces and Modules
- A.12. Sequence Expressions and Workflows
Product information
- Title: Expert F# 2.0
- Author(s):
- Release date: June 2010
- Publisher(s): Apress
- ISBN: 9781430224310
You might also like
book
Expert F# 4.0, Fourth Edition
Learn from F#'s inventor to become an expert in the latest version of this powerful programming …
book
Expert C++
Design and architect real-world scalable C++ applications by exploring advanced techniques in low-level programming, object-oriented programming …
book
Windows® Internals, Sixth Edition, Part 2
Delve inside Windows architecture and internals—and see how core components work behind the scenes. Led by …
book
Financial Instrument Pricing Using C++, 2nd Edition
An integrated guide to C++ and computational finance This complete guide to C++ and computational finance …