PDF Grokking Functional Programming 1st Edition Michal Plachta download
PDF Grokking Functional Programming 1st Edition Michal Plachta download
com
https://ebookmeta.com/product/grokking-functional-
programming-1st-edition-michal-plachta-2/
OR CLICK BUTTON
DOWNLOAD NOW
Michał Płachta
To comment go to liveBook
Manning
Shelter Island
For more information on this and other Manning titles go to
www.manning.com
Copyright
ISBN: 9781617291838
Dedication
To my dear family: Marta, Wojtek, and Ola, for all the good
vibes and inspiration.
2 Pure functions
Why do we need pure functions?
Coding imperatively
Breaking the code
Passing copies of the data
Breaking the code . . . again
Recalculating instead of storing
Focusing on the logic by passing the state
Where did the state go?
The difference between impure and pure functions
Coffee break: Refactoring to a pure function
Coffee break explained: Refactoring to a pure function
In pure functions we trust
Pure functions in programming languages
Difficulty of staying pure...
Pure functions and clean code
Coffee break: Pure or impure?
Coffee break explained: Pure or impure?
Using Scala to write pure functions
Practicing pure functions in Scala
Testing pure functions
Coffee break: Testing pure functions
Coffee break explained: Testing pure functions
3 Immutable values
The fuel for the engine
Another case for immutability
Can you trust this function?
Mutability is dangerous
Functions that lie... again
Fighting mutability by working with copies
Coffee break: Getting burned by mutability
Coffee break explained: Getting burned by mutability
Introducing shared mutable state
State’s impact on programming abilities
Dealing with the moving parts
Dealing with the moving parts using FP
Immutable values in Scala
Building our intuition about immutability
Coffee break: The immutable String API
Coffee break explained: The immutable String API
Hold on . . . Isn’t this bad?
Purely functional approach to shared mutable state
Practicing immutable slicing and appending
4 Functions as values
Implementing requirements as functions
Impure functions and mutable values strike back
Using Java Streams to sort the list
Function signatures should tell the whole story
Changing requirements
We just pass the code around!
Using Java’s Function values
Using the Function syntax to deal with code duplication
Passing user-defined functions as arguments
Coffee break: Functions as parameters
Coffee break explained: Functions as parameters
Problems with reading functional Java
Passing functions in Scala
Deep dive into sortBy
Practicing map
Practicing filter
Language: English
Transcriber’s Note: This story appeared in the July 15, 1928 issue
of Adventure magazine.
*** END OF THE PROJECT GUTENBERG EBOOK WHEN EVERYBODY
KNEW ***
Updated editions will replace the previous one—the old editions will
be renamed.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.