没有合适的资源?快使用搜索试试~ 我知道了~
Functional Programming in Java How functional techniques improve...
5星 · 超过95%的资源 需积分: 9 37 下载量 27 浏览量
2017-11-29
11:35:03
上传
评论 1
收藏 4.28MB PDF 举报
温馨提示
Functional Programming in Java How functional techniques improve your Java programs 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
资源推荐
资源详情
资源评论
Why Functional Programming?
Functional programs contain no assignment statements, so variables, once given a value,
never change. More generally, functional programs contain no side-effects at all. A function
call can have no effect other than to compute its result. This eliminates a major source of bugs,
and also makes the order of execution irrelevant—since no side-effect can change an expres-
sion’s value, it can be evaluated at any time. This relieves the programmer of the burden of pre-
scribing the flow of control. Since expressions can be evaluated at any time, one can freely
replace variables by their values and vice versa—that is, programs are “referentially transpar-
ent.” This freedom helps make functional programs more tractable mathematically than their
conventional counterparts.
—John Hughes
“Why Functional Programming Matters”
I call it my billion-dollar mistake … My goal was to ensure that all use of references should be
absolutely safe, with checking performed automatically by the compiler. But I couldn’t resist the
temptation to put in a null reference, simply because it was so easy to implement. This has led
to innumerable errors, vulnerabilities, and system crashes, which have probably caused a bil-
lion dollars of pain and damage in the last forty years.
—Tony Hoare
Program testing can be a very effective way to show the presence of bugs, but is hopelessly inad-
equate for showing their absence.
—Edsger W. Dijkstra
Testing by itself does not improve software quality. Test results are an indicator of quality, but
in and of themselves, they don’t improve it. Trying to improve software quality by increasing
the amount of testing is like trying to lose weight by weighing yourself more often.
—Steve McConnell
The proper use of comments is to compensate for our failure to express ourselves in code.
—Robert C. Martin
In programming the hard part isn’t solving problems, but deciding what problems to solve.
—Paul Graham
Object oriented programming makes code understandable by encapsulating moving parts.
Functional programming makes code understandable by minimizing moving parts.
—Michael Feathers
Licensed to <null>
Functional Programming
in Java
HOW FUNCTIONAL TECHNIQUES
IMPROVE
YOUR JAVA PROGRAMS
PIERRE-YVES SAUMONT
MANNING
SHELTER ISLAND
Licensed to <null>
For online information and ordering of this and other Manning books, please visit
www.manning.com. The publisher offers discounts on this book when ordered in quantity.
For more information, please contact
Special Sales Department
Manning Publications Co.
20 Baldwin Road
PO Box 761
Shelter Island, NY 11964
Email: orders@manning.com
©2017 by Manning Publications Co. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in
any form or by means electronic, mechanical, photocopying, or otherwise, without prior written
permission of the publisher.
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the designations have been printed in initial caps
or all caps.
Recognizing the importance of preserving what has been written, it is Manning’s policy to have
the books we publish printed on acid-free paper, and we exert our best efforts to that end.
Recognizing also our responsibility to conserve the resources of our planet, Manning books
are printed on paper that is at least 15 percent recycled and processed without the use of
elemental chlorine.
Manning Publications Co. Development editor: Marina Michaels
20 Baldwin Road Technical development editor: Mark Elston
PO Box 761 Project editor: Janet Vail
Shelter Island, NY 11964 Copyeditor: Andy Carroll
Proofreaders: Katie Tennant and Melody Dolab
Technical proofreader: Alessandro Campeis
Typesetter: Dottie Marsico
Cover designer: Leslie Haimes
ISBN 9781617292736
Printed in the United States of America
12345678910–EBM–222120191817
Licensed to <null>
iii
brief contents
1
■
What is functional programming? 1
2
■
Using functions in Java 16
3
■
Making Java more functional 57
4
■
Recursion, corecursion, and memoization 94
5
■
Data handling with lists 124
6
■
Dealing with optional data 151
7
■
Handling errors and exceptions 176
8
■
Advanced list handling 203
9
■
Working with laziness 230
10
■
More data handling with trees 256
11
■
Solving real problems with advanced trees 290
12
■
Handling state mutation in a functional way 321
13
■
Functional input/output 342
14
■
Sharing mutable state with actors 370
15
■
Solving common problems functionally 394
Licensed to <null>
剩余475页未读,继续阅读
资源评论
- 风中之尘092018-07-10非常好的一本Java函数编程资料
- hawking19822018-09-18还不错,挺清晰
yinkaisheng-nj
- 粉丝: 763
- 资源: 6231
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功