万本电子书0元读

万本电子书0元读

顶部广告

Mastering F#电子书

售       价:¥

1人正在读 | 0人评论 9.8

作       者:Alfonso García-Caro Núñez

出  版  社:Packt Publishing

出版时间:2016-11-01

字       数:257.1万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
A comprehensive and in-depth guide to writing functional programs using F# About This Book Learn how to manage, run, and automate your servers using Puppet Explore how to use F# to develop large-scale applications quickly and simply, and become more productive in today’s age of cloud computing and multi-core programming This easy-to-follow guide is packed with real-world examples that will jump-start you with F# development on the .NET platform Who This Book Is For If you are a C# developer with a basic knowledge of F# and want to explore the functional programming paradigm further to master your F# skills, then this book is for you. What You Will Learn Understand the basics of F# and organize F# source code with Visual Studio Work with F# data structures and create functional data structures in F# interoperate with C# Build and use asynchronous programming patterns with F# Create and use type providers that help perform data analysis from within Visual Studio Develop applications with pure F# code in WPF or ASP.NET MVC Find out how to perform distributed programming with ServiceBus or ZeroMQ Visualize data with charts, and work with Excel and R language Type providers In Detail F# is a multi-paradigm programming language that encompasses object-oriented, imperative, and functional programming language properties. Now adopted in a wide range of application areas and is supported both by industry-leading companies who provide professional tools and by an active open community, F# is rapidly gaining popularity as it emerges in digital music advertising, creating music-focused ads for Spotify, Pandora, Shazam, and anywhere on the web. This book will guide you through the basics and will then help you master F#. The book starts by explaining how to use F# with Visual Studio, file ordering, and the differences between F# and C# in terms of usage. It moves on to explain the functional core of F# such as data types, type declarations, immutability, strong type interference, pattern matching, records, F# data structures, sequence expressions, and lazy evaluation. Next, the book takes you through imperative and asynchronous programming, F# type providers, applications, and testing in F#. Finally, we look into using F# with distributed programming and using F# as a suitable language for data science. In short, this book will help you learn F# for real-world applications and increase your productivity with functional programming. Style and approach This easy-to-follow guide with syntaxes will help you master the concepts of F#. Packed with in-depth examples of real-world uses, this book covers each topic in detail with a reference to C#, so you will understand the difference between the languages.
目录展开

Mastering F#

Mastering F#

Credits

About the Authors

About the Reviewer

www.PacktPub.com

Why subscribe?

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. Getting Started in F#

Key features of F#

Functional and imperative languages

F# and integrated development environments

Using F# with Visual Studio

F# project structure

F# Script File

Using the F# Interactive window

The Visual Studio interactive window

The FSI interactive window

Basic values

Getting started with functions

Partially applied functions

Recursive functions

Higher-order functions

Summary

2. Functional Core with F#

F# primitive types

The unit type

Operator precedence

Custom operators

Immutability, type declarations, and strong type inference

Pattern matching

Functions with pattern matching

Pattern expressions

Guard expressions

Incomplete matches

Wildcard pattern

Tuples

Value matching

Records

Updating records

Functional update

Mutable fields

Field label declarations

Value matching

Common Language Infrastructure mutable records

Union cases

Options in F#

Structural equality and comparison

Custom equality and comparison

Reference cells and side-effects

Active patterns

Partial active patterns

Summary

3. Data Structures in F#

F# Collections

Sequence

Sequence expressions

Working with Seq functions

Creating sequences

Searching and finding elements

Sequence generators

Sequence computation operations

Arrays

Working with Array functions

Arrays and tuples

Array comprehensions

Array.Parallel module

Lists

Tail recursion

List and tuples

List comprehensions

Sets

Map

Advanced data structures

Binary trees

Balanced red-black trees

Summary

4. Imperative Programming in F#

Control structures

Looping

The for...to expression

The for...in expression

The while...do expression

Conditions

Working with conditions

Object-oriented programming

Defining a class

Constructors

Structs

Declaring fields, properties, methods, and static methods

Fields

Explicit fields

Properties

Static properties

Indexed properties

Methods

Static methods

Abstract and virtual methods

Parameters

Inheritance

Abstract

Defining an interface

Implement interface in F# types

Interface inheritance

Extensions

Generics

Using generic constructs

Wildcard generic constructs

Generic constraints

Generic extensions

Using LINQ in F#

Events

Declaring events

Event processing

Declaring delegates

Observables

Interop with C#

Optional parameters

Algebraic data types

Generic extensions consumable in C#

Exposing F# functionality to C#

Summary

5. Asynchronous Programming

Asynchronous workflows in F#

Using let!

Understanding async workflows

Async module

Async.AsBeginEnd

Async.AwaitEvent

Async.AwaitIAsyncResult

Async.AwaitWaitHandle

Async.AwaitTask

Async.FromBeginEnd

Async.FromContinuations

Async.Start

Async.StartChild

Async.StartAsTask

Async.StartChildAsTask

Async.StartImmediate

Async.SwitchToNewThread

Async.SwitchToThreadPool

Async.SwitchToContext

Async.Parallel

Async.OnCancel

Actor programming with MailboxProcessor

Design patterns with MailboxProcessor

Type-safe MailboxProcessor, an imperative approach

Type-safe MailboxProcessor, a functional approach

Messages and union types

Reporting results from the mailbox

Agents and errors

MailboxProcessor functions

Implementing a non-blocking queue

Reactive programming with async workflows

Summary

6. Type Providers

SQL type provider

Preparing the test database

Using the type provider

Querying the data

SQL entity type provider

Using the type provider

Querying the data

OData type provider

Prerequisites

Using the type provider

Querying the data

Web service type provider

Prerequisites

Using the type provider

Querying the data

Data analysis with type providers

Prerequisites

Using the type provider

Query builder

Summary

7. Web Programming in F#

ASP.NET Web API 2

Suave

Routing with Suave

Templating with Suave

WebSharper

Installing WebSharper

Sitelets

UI.Next

Fable

Using Fable with React

Summary

8. Application Development in F#

GitHub Electron

npm

webpack

Using React components with Electron

npm start

Automatic refresh on code changes

Using Node APIs from the renderer process

Summary

9. Testing in F#

Unit testing

Unit tests with NUnit

Setting up the test environment

Mocking

F# idiomatic assertions

Asynchronous tests

Running NUnit tests with FAKE

NUnit and Fable

Property-based testing

Integrating FsCheck and NUnit

Automated browser testing

Summary

10. Distributed Programming in F#

Actor Model

MailboxProcessor

Akka.NET

Supervision

Remote actors

Summary

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部