主页 详情

《Scala编程 第2版 英文》_(美)万普勒,(美)佩恩著_13997115_9787564159221

【书名】:《Scala编程 第2版 英文》
【作者】:(美)万普勒,(美)佩恩著
【出版社】:南京:东南大学出版社
【时间】:2015
【页数】:558
【ISBN】:9787564159221
【SS码】:13997115

最新查询

内容简介

1.Zero to Sixty:Introducing Scala

Why Scala?

The Seductions of Scala

What About Java 8?

Installing Scala

Using SBT

Running the Scala Command-Line Tools

Running the Scala REPL in IDEs

A Taste of Scala

A Taste of Concurrency

Recap and What's Next

2.Type Less,Do More

Semicolons

Variable Declarations

Ranges

Partial Functions

Method Declarations

Method Default and Named Arguments

Methods with Multiple Argument Lists

A Taste of Futures

Nesting Method Definitions and Recursion

Inferring Type Information

Reserved Words

Literal Values

Integer Literals

Floating-Point Literals

Boolean Literals

Character Literals

String Literals

Symbol Literals

Function Literals

Tuple Literals

Option,Some,and None:Avoiding nulls

Sealed Class Hierarchies

Organizing Code in Files and Namespaces

Importing Types and Their Members

Imports Are Relative

Package Objects

Abstract Types Versus Parameterized Types

Recap and What's Next

3.RoundingOuttheBasics

Operator Overloading?

Syntactic Sugar

Methods with Empty Argument Lists

Precedence Rules

Domain-Specific Languages

Scala if Statements

Scala for Comprehensions

for Loops

Generator Expressions

Guards:Filtering Values

Yielding

Expanded Scope and Value Definitions

Other Looping Constructs

Scala while Loops

Scala do-while Loops

Conditional Operators

Using try,catch,and finally Clauses

Call by Name,Call by Value

lazy val

Enumerations

Interpolated Strings

Traits:Interfaces and"Mixins"in Scala

Recap and What's Next

4.PatternMatching

A Simple Match

Values,Variables,and Types in Matches

Matching on Sequences

Matching on Tuples

Guards in case Clauses

Matching on case Classes

unapply Method

unapplySeq Method

Matching on Variable Argument Lists

Matching on Regular Expressions

More on Binding Variables in case Clauses

More on Type Matching

Sealed Hierarchies and Exhaustive Matches

Other Uses of Pattern Matching

Concluding Remarks on Pattern Matching

Recap and What's Next

5.Implicits

Implicit Arguments

Using implicitly

Scenarios for Implicit Arguments

Execution Contexts

Capabilities

Constraining Allowed Instances

Implicit Evidence

Working Around Erasure

Improving Error Messages

Phantom Types

Rules for Implicit Arguments

Implicit Conversions

Build Your Own String Interpolator

The Expression Problem

Type Class Pattern

Technical Issues with Implicits

Implicit Resolution Rules

Scala's Built-in Implicits

Wise Use of Implicits

Recap and What's Next

6.Functional Programmingin Scala

What Is Functional Programming?

Functions in Mathematics

Variables That Aren't

Functional Programming in Scala

Anonymous Functions,Lambdas,and Closures

Purity Inside Versus Outside

Recursion

Tail Calls and Tail-Call Optimization

Trampoline for Tail Calls

Partially Applied Functions Versus Partial Functions

Currying and Other Transformations on Functions

Functional Data Structures

Sequences

Maps

Sets

Traversing,Mapping,Filtering,Folding,and Reducing

Traversal

Mapping

Flat Mapping

Filtering

Folding and Reducing

Left Versus Right Traversals

Tail Recursion Versus Traversals of Infinite Collections

Combinators:Software's Best Component Abstractions

What About Making Copies?

Recap and What's Next

7.forComprehensionsinDepth

Recap:The Elements of for Comprehensions

for Comprehensions:Under the Hood

Translation Rules of for Comprehensions

Options and Other Container Types

Option as a Container

Either:A Logical Extension to Option

Try:When There Is No Do

Scalaz Validation

Recap and What's Next

8.Object-Oriented Programmingin Scala

Class and Object Basics

Reference Versus Value Types

Value Classes

Parent Types

Constructors in Scala

Fields in Classes

The Uniform Access Principle

Unary Methods

Validating Input

Calling Parent Class Constructors(and Good Object-Oriented Design)

Good Object-Oriented Design:A Digression

Nested Types

Recap and What's Next

9.Traits

Interfacesin Java 8

Traits as Mixins

Stackable Traits

Constructing Traits

Classor Trait?

Recap and What's Next

10.The Scala Object System,PartⅠ

Parameterized Types:Variance Under Inheritance

Functions Under the Hood

Variance of Mutable Types

Variance in Scala Versus Java

The Scala Type Hierarchy

Much Ado About Nothing(and Null)

Products,Case Classes,and Tuples

The Predef Object

Implicit Conversions

Type Definitions

Condition Checking Methods

Input and Output Methods

Miscellaneous Methods

Equality of Objects

The equals Method

The==and!=Methods

The eq and ne Methods

Array Equality and the same Elements Method

Recap and What's Next

11.The Scala Object System,Part Ⅱ

Overriding Members of Classes and Traits

Avoid Overriding Concrete Members

Attempting to Override final Declarations

Overriding Abstract and Concrete Methods

Overriding Abstract and Concrete Fields

Overriding Abstract Types

When Accessor Methods and Fields Are Indistinguishable:The Uniform Access Principle

Linearization of an Object's Hierarchy

Recap and What's Next

12.The Scala Collections Library

Generic,Mutable,Immutable,Concurrent,and Parallel Collections,Oh My!

The scala.collection Package

The collection.concurrent Package

The collection.convert Package

The collection.generic Package

The collection.immutable Package

The scala.collection.mutable Package

The scala.collection.parallel Package

Choosing a Collection

Design Idioms in the Collections Library

Builder

Can Build From

Like Traits

Specialization for Value Types

Miniboxing

Recap and What'sNext

13.Visibility Rules

Public Visibility:The Default

Visibility Keywords

Public Visibility

Protected Visibility

Private Visibility

Scoped Private and Protected Visibility

Final Thoughts on Visibility

Recap and What'sNext

14.Scala's Type System,Part Ⅰ

Parameterized Types

Variance Annotations

Type Constructors

Type Parameter Names

Type Bounds

Upper Type Bounds

Lower Type Bounds

Context Bounds

View Bounds

Understanding Abstract Types

Comparing Abstract Types and Parameterized Types

Self-Type Annotations

Structural Types

Compound Types

Type Refinements

Existential Types

Recap and What's Next

15.Scala'sTypeSystem,Part Ⅱ

Path-Dependent Types

C.this

C.super

path.x

Dependent Method Types

Type Projections

Singleton Types

Types for Values

Tuple Types

Function Types

Infix Types

Higher-Kinded Types

Type Lambdas

Self-Recursive Types:F-Bounded Polymorphism

Recap and What's Next

16.Advanced Functional Programming

Algebraic Data Types

Sum Types Versus Product Types

Properties of Algebraic Data Types

Final Thought on Algebraic Data Types

Category Theory

About Categories

The Functor Category

The Monad Category

The Importance ofMonad

Recap and What's Next

17.Tools for Concurrency

The scala.sys.process Package

Futures

Async

Robust,Scalable Concurrency with Actors

Akka:Actors for Scala

Actors:Final Thoughts

Pickling and Spores

Reactive Programming

Recap and What's Next

18.Scala for Big Data

Big Data:A Brief History

Improving Map Reduce with Scala

Moving Beyond Map Reduce

Categories for Mathematics

A List of Scala-Based Data Tools

Recap and What's Next

19.Dynamic Invocation in Scala

A Motivating Example:ActiveRecord in Ruby on Rails

Dynamic Invocation in Scala with the Dynamic Trait

DSL Considerations

Recap andWhat'sNext

20.Domain-Specific Languages in Scala

Examples:XML and JSON DSLs for Scala

Internal DSLs

External DSLs with Parser Combinators

About Parser Combinators

A Payroll External DSL

Internal Versus External DSLs:Final Thoughts

Recap and What's Next

21.Scala Tools and Libraries

Command-Line Tools

scalac Command-Line Tool

The scala Command-Line Tool

The scalap and iavap Command-Line Tools

The scaladoc Command-Line Tool

The fsc Command-Line Tool

Build Tools

SBT, the Standard Build Tool for Scala

Other Build Tools

Integration with IDEs and Text Editors

Text Editors

Test-Driven Development in Scala

Third-Party Libraries

Recap and What's Next

22.Java Interoperability

Using Java Names in Scala Code

Java and Scala Generics

JavaBean Properties

AnyVal Types and Java Primitives

Scala Names in Java Code

Recap and What's Next

23.Application Design

Recap of What We Already Know

Annotations

Traits as Modules

Design Patterns

Creational Patterns

Structural Patterns

Behavioral Patterns

Better Design with Design by Contract

The Parthenon Architecture

Recap and What's Next

24.Metaprogramming:Macros and Reflection

Tools for Understanding Types

Runtime Reflection

Reflecting on Types

Class Tags,Type Tags,and Manifests

Scala's Advanced Runtime Reflection API

Macros

A Macro Example:Enforcing Invariants

Final Thoughts on Macros

Wrapping Up and Looking Ahead

A.References

Index


书查询(www.shuchaxun.com)本网页唯一编码:
056dfea1faf2d96ebf634cf432d94630#116f7d251bb78bf559d4145d333d05a0#167772594#13997115.zip