Foundations of F#

Book description

Functional programming (FP) is the future of .NET programming, and F# is much more than just an FP language. Every professional .NET programmer needs to learn about FP, and there's no better way to do it than by learning F#, and no easier way to learn F# than from Foundations of F#.

If you're already familiar with FP, youll find F# the language youve always dreamed of. All .NET programmers will find F# an exciting real-world alternative to C# and Visual Basic. This book is likely to have many imitators, but few true competitors. Written by F# evangelist Rob Pickering, and tech reviewed by F#'s main designer, Don Syme, this is an elegant, comprehensive introduction to all aspects of the language and an incisive guide to using F# for real-world professional development. F# is the future of programming (not just on .NET), and the future is now.

Table of contents

  1. Title Page
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. Foreword
  6. About the Author
  7. About the Technical Reviewer
  8. Acknowledgements
  9. Preface
  10. CHAPTER 1 Introduction
    1. What Is Functional Programming?
    2. Why Is Functional Programming Important?
    3. What Is F#?
    4. Who Is Using F#?
    5. Who Is This Book For?
    6. What's Next?
  11. CHAPTER 2 How to Obtain, Install, and Use F#
    1. Obtaining F#
    2. Installing F# on Windows
    3. Installing F# on Linux
    4. Using F# in Different Ways
    5. Installing the Software Used in This Book
    6. Summary
  12. CHAPTER 3 Functional Programming
    1. Identifiers
    2. Keywords
    3. Literals
    4. Values and Functions
    5. Scope
    6. Recursion
    7. Anonymous Functions
    8. Operators
    9. Lists
    10. List Comprehensions
    11. Control Flow
    12. Types and Type Inference
    13. Pattern Matching
    14. Defining Types
    15. Exceptions and Exception Handling
    16. Lazy Evaluation
    17. Summary
  13. CHAPTER 4 Imperative Programming
    1. The unit Type
    2. The mutable Keyword
    3. Defining Mutable Record Types
    4. The ref Type
    5. Arrays
    6. Array Comprehensions
    7. Control Flow
    8. Loops over Comprehensions
    9. Calling Static Methods and Properties from .NET Libraries
    10. Using Objects and Instance Members from .NET Libraries
    11. Using Indexers from .NET Libraries
    12. Working with Events from .NET Libraries
    13. Pattern Matching over .NET Types
    14. The |> Operator
    15. Summary
  14. CHAPTER 5 Object-Oriented Programming
    1. Casting
    2. Type Tests
    3. Type Annotations for Subtyping
    4. Records As Objects
    5. F# Types with Members
    6. Object Expressions
    7. Defining Interfaces
    8. Implementing Interfaces
    9. Classes, Fields, and Explicit Constructors
    10. Implicit Class Construction
    11. Classes and Inheritance
    12. Classes and Methods
    13. Accessing the Base Class
    14. Properties and Indexers
    15. Classes and Static Methods
    16. Overriding Methods from Non-F# Libraries
    17. Defining Delegates
    18. Structs
    19. Enums
    20. Summary
  15. CHAPTER 6 Organizing, Annotating, and Quoting Code
    1. Modules
    2. Namespaces
    3. Opening Namespaces and Modules
    4. Giving Namespaces and Modules Aliases
    5. Signature Files
    6. Module Scope
    7. Module Execution
    8. Optional Compilation
    9. Comments
    10. Doc Comments
    11. Custom Attributes
    12. Quoted Code
    13. Summary
  16. CHAPTER 7 The F# Libraries
    1. Libraries Overview
    2. The Native F# Library FSLib.dll
    3. The ML Compatibility Library MLLib.dll
    4. Summary
  17. CHAPTER 8 User Interfaces
    1. Introducing WinForms
    2. Drawing WinForms
    3. Working with Controls in WinForms
    4. Using the Visual Studio Form Designer's Forms in F#
    5. Working with WinForms Events and the IEvent Module
    6. Creating New Forms Classes
    7. Introducing ASP.NET 2.0
    8. Creating an IHttpHandler
    9. Working with ASP.NET Web Forms
    10. Introducing Windows Presentation Foundation
    11. Introducing Windows Presentation Foundation 3D
    12. Summary
  18. CHAPTER 9 Data Access
    1. The System.Configuration Namespace
    2. The System.IO Namespace
    3. The System.Xml Namespace
    4. ADO.NET
    5. The EntLib Data Access Block
    6. Data Binding
    7. Data Binding and the DataGridView
    8. ADO.NET Extensions
    9. Introducing LINQ
    10. Using LINQ to XML
    11. Using LINQ to SQL
    12. Summary
  19. CHAPTER 10 Distributed Applications
    1. Networking Overview
    2. Using TCP/IP Sockets
    3. Using HTTP
    4. Calling Web Services
    5. Creating Web Services
    6. Windows Communication Foundation
    7. Hosting WCF Services
    8. Summary
  20. CHAPTER 11 Language-Oriented Programming
    1. What Is Language-Oriented Programming?
    2. Data Structures As Little Languages
    3. Metaprogramming with Quotations
    4. An Arithmetic-Language Implementation
    5. Summary
  21. CHAPTER 12 The F# Tool Suite and .NET Programming Tools
    1. Using Useful fsc.exe Command-Line Switches
    2. Using fsi.exe Effectively
    3. Using the Source Directory Macro
    4. Writing NUnit Tests
    5. Using Assembly Browsers
    6. Using Debugging Tools
    7. Using Profiling Tools
    8. Summary
  22. CHAPTER 13 Compatibility and Advanced Interoperation
    1. Calling F# Libraries from C#
    2. Using F# with the .NET Framework Versions 1 and 1.1
    3. Calling Using COM Objects
    4. Using P/Invoke
    5. Using Inline IL
    6. Using F# from Native Code via COM
    7. Summary
  23. Index

Product information

  • Title: Foundations of F#
  • Author(s): Robert Pickering
  • Release date: June 2007
  • Publisher(s): Apress
  • ISBN: 9781590597576