Monday, June 25, 2007

Foundations Of F# (FSharp)

Foundations Of F#
Title: Foundations of F#
Author: Robert Pickering
ISBN: 1590597575
Pages: 360 pp.
Published: May 2007



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, you’ll find F# the language you’ve always dreamed of. And 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
Foreword xiii
About the Author xv
About the Technical Reviewer xvii
Acknowledgments . xix
Preface: The Story of the Book . xxi

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 182
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 207

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




Sample Chapter: Ch. 01 - Introduction
Amazon Link: Foundations of F#

No comments: