1 / 109
文档名称:

Pro Scala - Monadic Design Patterns for the Web.pdf

格式:pdf   页数:109页
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

Pro Scala - Monadic Design Patterns for the Web.pdf

上传人:bolee65 2014/4/14 文件大小:0 KB

下载得到文件列表

Pro Scala - Monadic Design Patterns for the Web.pdf

文档介绍

文档介绍:Pro Scala: Monadic Design Patterns for the Web
. Meredith

c Draft date March 17, 2010
Contents
Contents i
Preface 1
1 Motivation and Background 3
Where are we . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
The concurrency squeeze: from the hardware up, from the
web down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Ubiquity of robust, high-performance virtual machines . . . . 5
Advances in functional programming, monads and the awk-
ward squad . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Where are we going . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
A functional web . . . . . . . . . . . . . . . . . . . . . . . . . 10
DSL-based design . . . . . . . . . . . . . . . . . . . . . . . . . 12
How are we going to get there . . . . . . . . . . . . . . . . . . . . . . 13
Leading by example . . . . . . . . . . . . . . . . . . . . . . . . 13
Chapter map . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2 Toolbox 21
Introduction to notation and terminology . . . . . . . . . . . . . . . . 21
Scala . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Maths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Introduction to core design patterns . . . . . . . . . . . . . . . . . . . 21
A little history . . . . . . . . . . . . . . . . . . . . . . . . . . 21
i
ii CONTENTS
Variations in presentation . . . . . . . . . . . . . . . . . . . . . . . . 26
A little more history . . . . . . . . . . . . . . . . . . . . . . . 26
3 An IO-monad for http streams 39
Code first, questions later . . . . . . . . . . . . . . . . . . . . . . . . 39
An HTTP-request processor . . . . . . . . . . . . . . . . . . . 46
What we did . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Synchrony, asynchrony and buffering . . . . . . . . . . . . . .