Contents

Foreword

About the Author

About the Technical Reviewer

Acknowledgments

Preface


CHAPTER 1      Introduction

                             What Is Functional Programming?

                             Why Is Functional Programming Important?

                             What Is F#?

                             Who Is Using F#?

                             Who Is This Book For?

                             What's Next?

CHAPTER 2      How to Obtain, Install, and Use F#

                             Obtaining F#

                             Installing F# on Windows

                             Installing F# on Linux

                             Using F# in Different Ways

                             Installing the Software Used in This Book

                             Summary

CHAPTER 3      Functional Programming

                             Identifiers

                             Keywords

                             Literals

                             Values and Functions

                             Scope

                             Recursion

                             Anonymous Functions

                             Operators

                             Lists

                             List Comprehensions

                             Control Flow

                             Types and Type Inference

                             Pattern Matching

                             Defining Types

                             Exceptions and Exception Handling

                             Lazy Evaluation

                             Summary

CHAPTER 4      Imperative Programming

                             The unit Type

                             The mutable Keyword

                             Defining Mutable Record Types

                             The ref Type

                             Arrays

                             Array Comprehensions

                             Control Flow

                             Loops over Comprehensions

                             Calling Static Methods and Properties from .NET Libraries

                             Using Objects and Instance Members from .NET Libraries

                             Using Indexers from .NET Libraries

                             Working with Events from .NET Libraries

                             Pattern Matching over .NET Types

                             The |> Operator

                             Summary

CHAPTER 5      Object-Oriented Programming

                             Casting

                             Type Tests

                             Type Annotations for Subtyping

                             Records As Objects

                             F# Types with Members

                             Object Expressions

                             Defining Interfaces

                             Implementing Interfaces

                             Classes, Fields, and Explicit Constructors

                             Implicit Class Construction

                             Classes and Inheritance

                             Classes and Methods

                             Accessing the Base Class

                             Properties and Indexers

                             Classes and Static Methods

                             Overriding Methods from Non-F# Libraries

                             Defining Delegates

                             Structs

                             Enums

                             Summary

CHAPTER 6      Organizing, Annotating, and Quoting Code

                             Modules

                             Namespaces

                             Opening Namespaces and Modules

                             Giving Namespaces and Modules Aliases

                             Signature Files

                             Module Scope

                             Module Execution

                             Optional Compilation

                             Comments

                             Doc Comments

                             Custom Attributes

                             Quoted Code

                             Summary

CHAPTER 7      The F# Libraries

                             Libraries Overview

                                   The Native F# Library FSLib.dll

                                   The ML Compatibility Library MLLib.dll

                             The Native F# Library FSLib.dll

                                   The Microsoft.FSharp.Core.Operators Module

                                   The Microsoft.FSharp.Reflection Module

                                   The Microsoft.FSharp.Collections.Seq Module

                                   The Microsoft.FSharp.Core.Enum Module

                                   The Microsoft.FSharp.Text.Printf Module

                                   The Microsoft.FSharp.Control.IEvent Module

                                   The Microsoft.FSharp.Math Namespace

                             The ML Compatibility Library MLLib.dll

                                   The Microsoft.FSharp.Compatibility.OCaml.Pervasives Module

                                   The Microsoft.FSharp.Compatibility.OCaml.Arg Module

                             Summary

CHAPTER 8      User Interfaces

                             Introducing WinForms

                             Drawing WinForms

                             Working with Controls in WinForms

                             Using the Visual Studio Form Designer's Forms in F#

                             Working with WinForms Events and the IEvent Module

                             Creating New Forms Classes

                             Introducing ASP.NET 2.0

                             Creating an IHttpHandler

                             Working with ASP.NET Web Forms

                             Introducing Windows Presentation Foundation

                             Introducing Windows Presentation Foundation 3D

                             Summary

CHAPTER 9      Data Access

                             The System.Configuration Namespace

                             The System.IO Namespace

                             The System.Xml Namespace

                             ADO.NET

                             The EntLib Data Access Block

                             Data Binding

                             Data Binding and the DataGridView

                             ADO.NET Extensions

                             Introducing LINQ

                             Using LINQ to XML

                             Using LINQ to SQL

                             Summary

CHAPTER 10     Distributed Applications

                             Networking Overview

                             Using TCP/IP Sockets

                             Using HTTP

                             Calling Web Services

                             Creating Web Services

                             Windows Communication Foundation

                             Hosting WCF Services

                             Summary

CHAPTER 11     Language-Oriented Programming

                             What Is Language-Oriented Programming?

                             Data Structures As Little Languages

                                   A Data Structure−Based Language Implementation

                             Metaprogramming with Quotations

                             An Arithmetic-Language Implementation

                                   The Abstract Syntax Tree

                                   Tokenizing the Text: Fslex

                                   Generating a Parser: Fsyacc

                                   Using the Parser

                                   Interpreting the AST

                                   Compiling the AST

                                   Compilation vs. Interpretation

                             Summary

CHAPTER 12     The F# Tool Suite and .NET Programming Tools

                             Using Useful fsc.exe Command-Line Switches

                                   Basic Compiler Switches

                                   Compiler Optimization Switches

                                   Compiler Warning Switches

                                   Compiler Target Switches

                                   Signing and Versioning Switches

                                   Printing the Interface Switches

                                   Adding Resources Switches

                                   Generating HTML Switches

                                   CLI Version Switches

                                   Compilation Details Switches

                                   Statically Linking Switches

                             Using fsi.exe Effectively

                                   fsi.exe Commands

                                   Controlling the fsi.exe Environment

                                   fsi.exe Command-Line Switches

                             Using the Source Directory Macro

                             Writing NUnit Tests

                             Using Assembly Browsers

                             Using Debugging Tools

                             Using Profiling Tools

                                   Ntimer

                                   Perfmon and Performance Counters

                                   NProf

                                   CLR Profiler

                             Summary

CHAPTER 13     Compatibility and Advanced Interoperation

                             Calling F# Libraries from C#

                                   Returning Tuples

                                   Exposing Functions That Take Functions As Parameters

                                   Using Union Types

                                   Using F# Lists

                                   Defining Types in a Namespace

                                   Defining Classes and Interfaces

                             Using F# with the .NET Framework Versions 1 and 1.1

                             Calling Using COM Objects

                             Using P/Invoke

                             Using Inline IL

                             Using F# from Native Code via COM


                             Summary

INDEX

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset