Book description
Extend your C# skills to F#—and create data-rich computational and parallel software components faster and more efficiently. Focusing on F# 3.0 and Microsoft Visual Studio 2012, you’ll learn how to exploit F# features to solve both computationally-complex problems as well as everyday programming tasks.
Topics include: C# and F# data structures; F# for functional, object-oriented, and imperative programming; design patterns; type providers; and portable support for Windows 8. You’ll examine real-world applications, including Windows 8-style HTML5 and JavaScript apps, along with cloud and service apps. You’ll write your own type provider. And you’ll see how to expand F# computation power to high-performance GPU computing.
Table of contents
- Foreword
- Introduction
-
I. C# and F#
- 1. C# and F# Data Structures
-
2. Using F# for Object-Oriented Programming
- Using Classes
- Using Inheritance
- Using Abstract and Sealed Classes
- Creating an Instance
- Using Type Casting
- Defining an Interface
- Using F# Generic Types and Constraints
- Defining Structure
- Using Extension Methods
- Using Operator Overloading
- Using Delegates and Events
- Interoperating with a C# Project
- Real-World Samples
-
3. F# and Design Patterns
- Using Object-Oriented Programming and Design Patterns
-
Working with F# and Design Patterns
- Working with the Chain of Responsibility Pattern
- Working with the Adapter Pattern
- Working with the Command Pattern
- Working with the Observer Pattern
- Working with the Decorator Pattern
- Working with the Proxy Pattern
- Working with the Strategy Pattern
- Working with the State Pattern
- Working with the Factory Pattern
- Working with the Singleton Pattern
- Working with the Composite Pattern
- Working with the Template Pattern
- Working with the Private Data Class Pattern
- Working with the Builder Pattern
- Working with the Façade Pattern
- Working with the Memento Pattern
- Writing Design Patterns: Additional Notes
-
II. F#’s Unique Features
-
4. Type Providers
- Using the LINQ-to-SQL Type Provider
- SQL Entity Type Provider
- WSDL Type Provider
- OData Type Provider
- Other Type Providers
-
Query
- Using the select Operator
- Using the where Operator
- Using the join Operator
- Using the sortBy Operator
- Using the group Operator
- Using the take and skip Operators
- Using the min/max, average, and sum Operators
- Using the head, last, and nth Operators
- Using the count and distinct Operators
- Using the contains, exists, and find Operators
- Using the exactlyOne and all Operators
- SQL Query and F# Query
- Other F# Operators
- Using a Type Provider to Connect to the Windows Azure Marketplace
-
5. Write Your Own Type Provider
- What Is a Type Provider?
- Setting Up the Development Environment
- Exploring the HelloWorld Type Provider
- Using the Regular-Expression Type Provider
- Using the CSV Type Provider
- Using the Excel-File Type Provider
- Using the Type-Provider Base Class
- Using the Multi-Inheritance Type Provider
- Using the XML Type Provider
- Using the DGML-File Type Provider
- Separating Run Time and Design Time
- Generated Type Provider
- Using Type-Provider Snippets
- Type-Provider Limitations
-
6. Other Unique Features
- Working with Reference Cells
- Working with Object Expressions
- Working with Options
- Working with Units of Measure
- Working with Records
- Working with Discriminated Unions
- Working with Comparison Operations for a Record, Tuple, and DU
- Using Pattern Matching
- Working with Active Patterns
- Working with Exceptions
- Working with a Generic Invoke Function
- Working with Asynchronous and Parallel Workflows
- Working with Computation Expressions
- Using Reflection
- Working with Code Quotation
- Working with the Observable Module
- Using Lazy Evaluation, Partial Functions, and Memoization
- Summary
-
4. Type Providers
-
III. Real-World Applications
-
7. Portable Library and HTML/JavaScript
-
Developing Windows Store Applications with F#
- Creating an F# Portable Library
- Using the CompiledName Attribute
-
Exploring the Portable Library Samples
- Developing the WinRT Application
- Using an Array, List, and Seq
-
Creating a Tree Structure
- F# tree representation and traversal
- F# binary tree and in-order traversal
- Binary search tree
- Delete a tree
- Build a tree from pre-order and in-order sequences
- Build a BST from a pre-order iteration list
- Check that a BST has only one child
- Find the common elements from two BSTs
- Find the tree diameter
- Find the lowest common ancestor
- Validate the sum of all child nodes
- Calculate the tree boundary
- Using String Operations
- Using the Graph Library
- Examining Other Samples
- Using the Continuation Passing Style
- Working with HTML5 and WebSharper
-
Developing Windows Store Applications with F#
- 8. Cloud and Service Programming with F#
- 9. GPGPU with F#
- A. About the Author
-
7. Portable Library and HTML/JavaScript
- Index
- About the Author
- Copyright
Product information
- Title: F# for C# Developers
- Author(s):
- Release date: June 2013
- Publisher(s): Microsoft Press
- ISBN: 9780735670259
You might also like
book
Programming F#
Why learn F#? This multi-paradigm language not only offers you an enormous productivity boost through functional …
book
Programming F# 3.0, 2nd Edition
Why learn F#? With this guide, you’ll learn how this multi-paradigm language not only offers you …
book
F# 4.0 Design Patterns
Learn how to apply functional F# design patterns to a huge range of programming challenges, and …
book
F# for Scientists
This work strikes a balance between the pure functional aspects of F# and the object-oriented and …