You are previewing Building Web, Cloud, and Mobile Solutions with F#.

Building Web, Cloud, and Mobile Solutions with F#

Cover of Building Web, Cloud, and Mobile Solutions with F# by Daniel Mohl Published by O'Reilly Media, Inc.
  1. Building Web, Cloud, and Mobile Solutions with F#
  2. Preface
    1. Who This Book Is For
    2. Getting Set Up to Run the Examples
    3. How This Book Is Organized
    4. Conventions Used in This Book
    5. Using Code Examples
    6. Safari® Books Online
    7. How to Contact Us
    8. Acknowledgments
  3. 1. Building an ASP.NET MVC 4 Web Application with F#
    1. The F# ASP.NET MVC 4 Project Templates
      1. Finding and Installing the Templates
      2. Exploring the C# Project
      3. Dissecting the F# Project
    2. F# Controllers and Models
      1. Controllers
      2. Models
    3. Interacting with a Database
      1. Entity Framework
      2. Querying the Data
      3. Querying with Type Providers
    4. Taking Advantage of F#
      1. Moving to a More Functional Approach
      2. Understanding Pipelining and Partial Function Application
      3. Making the Controller More Functional
      4. Simplification with Pattern Matching
    5. Related Advanced Topics and Concepts
      1. Improving Responsiveness with Async Workflows
      2. Caching with MailboxProcessor
      3. Jumping on the Message Bus
      4. Continuation-Passing Style
      5. Creating a Custom Computation Expression
    6. Summary
  4. 2. Creating Web Services with F#
    1. Installing the Existing WCF Project Template
    2. Exploring the Output Code
      1. Consuming the Service
      2. Diving into Records
    3. Building an ASP.NET Web API Service
      1. Analyzing the Template
      2. Interacting with the HTTP Service
    4. Exploring Other Web Frameworks
      1. Service Stack
      2. Nancy
      3. Frank
    5. Testing Your Creation
      1. Getting Set Up
      2. Improving Tests with F#
      3. FsUnit
      4. Unquote
      5. NaturalSpec
    6. Summary
  5. 3. To the Cloud! Taking Advantage of Azure
    1. Building and Hosting F# on Azure
    2. Creating an F# Worker Role
    3. Introducing Fog
    4. Interacting with Azure Storage Options
      1. Blobs
      2. Tables
      3. Queue Storage
      4. SQL Azure
    5. Taking Advantage of the Azure Service Bus
      1. Queues
      2. Topics
    6. Exploring Authentication and Authorization
      1. Authentication and Authorization with ACS
      2. Claims-based Authentication
      3. Claims-based Authorization
    7. Building for Scalability
      1. Building the Web Role
      2. Understanding the PlaceOrderCommand
      3. On to the Worker Roles
      4. Wrapping Up the SQL Azure Worker Role
      5. Adding the Finishing Touches
      6. Caching
      7. CDN and Autoscaling
    8. Shining F# Examples
      1. {m}brace
      2. Cloud Numerics
      3. Framework for .NET Hadoop MapReduce
    9. Summary
  6. 4. Constructing Scalable Web and Mobile Solutions
    1. Scaling with Web Sockets
      1. Building a Web Socket Example with .NET 4.5 and IIS 8
      2. Creating a Web Socket Server with Fleck
    2. Using SignalR
      1. Building a Persistent Connection Example
      2. A JavaScript Client
      3. An F# Client
      4. Constructing a Hub Example
    3. Going Mobile
      1. The jQuery Mobile Approach
      2. Adding Windows Phone
    4. Combining F# and NoSQL
      1. MongoDB
      2. RavenDB
      3. CouchDB
    5. Summary
  7. 5. Functional Frontend Development
    1. Setting the Stage
    2. Looking at LiveScript
      1. Benefits
      2. Usage
      3. Example
    3. Exploring Pit
      1. Benefits
      2. Usage
      3. Example
    4. Diving into WebSharper
      1. Benefits
      2. Usage
      3. Example
    5. Summary
  8. A. Useful Tools and Libraries
    1. FAKE (F# Make)
    2. NuGet
      1. Basic Usage
      2. Useful NuGet Packages
    3. ExpectThat
  9. B. Useful Websites
    3. Visual Studio Gallery
  10. C. Client-Side Technologies That Go Well with F#
    1. CoffeeScript
    2. Sass
    3. Underscore.js
  11. Index
  12. About the Author
  13. Colophon
  14. Copyright

Appendix A. Useful Tools and Libraries

This appendix takes a look at a few tools and libraries that can enhance your F# web, cloud, and mobile development experience.

FAKE (F# Make)

FAKE is a build tool similar to Make that allows you to automate a sequence of steps that you wish to have done during each build. The permutations of things you might include in the automated build script for a solution are endless, but at a minimum you will likely want to compile all projects and run unit tests.

FAKE is built in F# and the scripts you use to create the automated build process are also created in F#. I’ve used FAKE in projects such as FsUnit and found it to be very helpful! It’s also a great way to get F# “in the door” for any groups or organizations that may be hesitant about bringing in F#. You can find several examples for getting started with FAKE here.


FAKE leverages MSBuild, so in addition to the power of F# and the various custom plug-ins that FAKE provides, you can take advantage of everything that MSBuild has to offer.


I’ve talked about NuGet at multiple points throughout the book; however, I haven’t provided much information about how to use NuGet. If NuGet is new to you, the best way to get started with it is to visit the NuGet website and read the documentation. A high-level overview is also provided in the next section.

Basic Usage

There are two primary ways to use NuGet from Visual Studio. One is through the Package Manager Console. Another is through the Manage NuGet ...

The best content for your career. Discover unlimited learning on demand for around $1/day.