PDF Grokking Functional Programming 1st Edition Michal Plachta Download
PDF Grokking Functional Programming 1st Edition Michal Plachta Download
com
OR CLICK BUTTON
DOWLOAD NOW
More products digital (pdf, epub, mobi) instant
download maybe you interests ...
https://ebookmeta.com/product/grokking-functional-
programming-1st-edition-michal-plachta-2/
https://ebookmeta.com/product/quick-functional-programming-quick-
programming-1st-edition-david-matuszek/
https://ebookmeta.com/product/expert-python-programming-second-
edition-michal-jaworski-tarek-ziade/
https://ebookmeta.com/product/expert-python-programming-2nd-
edition-michal-jaworski-tarek-ziade/
Programming Scala Scalability Functional Programming
Objects Third Edition Wampler Dean
https://ebookmeta.com/product/programming-scala-scalability-
functional-programming-objects-third-edition-wampler-dean/
https://ebookmeta.com/product/mastering-javascript-functional-
programming-1st-edition-federico-kereki/
https://ebookmeta.com/product/functional-programming-in-
kotlin-1st-edition-marco-vermeulen/
https://ebookmeta.com/product/functional-programming-with-c-
simon-j-painter/
https://ebookmeta.com/product/functional-programming-for-
dummies-1st-edition-john-paul-mueller/
inside front cover
(Continued on inside back cover)
Grokking Functional
Programming
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
FOOTNOTES:
[351] Gibbon, ch. liii. Constantine, Vit. Basil. ch. lxxiv-lxxvi.
[352] Voyage of Benjamin of Tudela, book i. ch. v. p. 44-52.
[353] Gibbon, c. liii.
[354] Gibbon, c. lv.
[355] Gibbon, c. lv.
[356] Gibbon, c. lv.
[357] Gibbon, c. lv.
[358] There seems much doubt about the story of the invention of the mariner’s
compass by Flavio Gioga, an Amalfite, in a.d. 1307. The city had ceased to have
any commercial importance since its sack by the Pisans in a.d. 1137 (Sismondi, i.
p. 303); while, on the other hand, Hallam shows that the compass was known as
early as a.d. 1100 (Mid. Ages, iii. 394); and Wachsmuth proves that it was used in
Sweden in a.d. 1250 (Ersch und Grüber’s Encycl. iii. 302). The Italian bussola,
from the French boussole, comes again from the Flemish Boxel (box);—hence,
probably, our term of “boxing” the compass. It was most likely a northern
discovery.
[359] Hallam remarks that “it was the singular fate of this city to have filled up the
interval between two periods of civilization, in neither of which she was destined
to be distinguished. Scarcely known before the end of the sixth century, Amalfi ran
a brilliant career as a free and trading republic, which was checked by the arms of
a conqueror in the middle of the twelfth.”—Mid. Ages, iii. 300.
[360] Sismondi, Republ. Ital. du Moyen Age, i. p. 203.
[361] Cassiodor. Var. l. 12. Epist. 24.
[362] The power of Venice at this early period (a.d. 774) is well shown by the aid
it gave to Charlemagne, at his request, during his siege of Pavia, of twenty-four
galleons said to have carried six thousand horse and foot. This fact has been
recently illustrated by Mr. W. De Gray Birch, of the MS. Room of the British
Museum, who has published a contemporary leaden tablet, in which it is recorded.
(Archæol. xliv. pp. 123-136. 1872.)
[363] Speaking of Timúr, Gibbon observes, “the lord of so many myriads of horse
was not master of a single galley,” c. lxv.
[364] Gibbon, c. lix.
[365] Gibbon, c. lix.
[366] Gibbon, c. lx.
[367] It seems worth while to append here a note concerning the results of the
principal Crusades.
First Crusade.—Preached by Peter the Hermit, and led by Robert Guiscard and
Godfrey de Bouillon, chiefly against the Seljuk Turks, a.d. 1096. Jerusalem taken,
a.d. 1099.
Second Crusade.—Preached by St. Bernard, and led by Louis VII. and Conrad III.,
a.d. 1146. Stopped by the Seljuk Turks, by their victory at Iconium (Konieh), a.d.
1147.
Third Crusade.—To avenge the capture in a.d. 1187 of Jerusalem by Saladin; and
led by Frederick Barbarossa, Richard Cœur-de-Lion, and Philip of France, a.d.
1188. Results: Acre, Joppa, and Askalon taken from Saladin, a.d. 1192.
Fourth Crusade.—Led by Baldwin, Count of Flanders, with aid from Venice, a.d.
1202. Results: taking of Zara and of Constantinople, a.d. 1204.
The remaining Crusades were, comparatively, unimportant.
[368] Gibbon, ch. lxiii.
[369] So late as Chardin, four hundred sail of vessels were occupied at Caffa
during forty days in the corn and fish trade. (“Voy. en Pérse,” i. pp. 46-48.) Clarke
found it wholly demolished by the Russians (“Travels,” i. p. 144)—and so it is now.
[370] Gibbon, ch. lxiii.
[371] The precise era of the invention and application of gunpowder is involved in
doubt, and has formed the subject of many learned disquisitions, not the least
interesting of which will be found in the 1st and 2nd vols. of Bishop Watson’s
“Chemical Essays.”
CHAPTER IX.
Ancient galleys—Different descriptions—Their outfit—Beaks—Stern—
Masts and sails—Oars—Mode of rowing—Single-banked galleys—
French galley—General Melvill’s theory—Charnock’s theory—Vossius’s
views—Mr. Howell’s plan—Plan of Revd. J. O. W. Haweis (Appendix
No. 1)—Our own views—Biremes—Triremes—Quadriremes—
Quinqueremes—Hexiremes and larger galleys—Suggested plan of
placing the rowers—Summary.