Haskell Design Patterns by Ryan Lemmer
Author:Ryan Lemmer [Lemmer, Ryan]
Language: eng
Format: mobi, azw3, epub, pdf
Publisher: Packt Publishing
Published: 2015-11-05T23:00:00+00:00
F.foldrM :: (Foldable t, Monad m) =>
(a -> b -> m b) -> b -> t a -> m b
as in
doSum = F.foldrM doPlus
where
doPlus acc x = do
putStrLn $ (show x) ++ " = " ++ (show acc)
return (acc + x)
main = doSum 0 aTree
Foldable things can be expressed as lists by folding (:) over the Foldable, for example:
main = do
print $ F.toList aTree
-- same as
print $ F.foldr (:) [] aTree
This example shows that not all folding accumulates destructively. Fold accumulates the input structure into a single Monoid value, but that single value might be a composite structure. In general, fold transforms a data structure (often radically).
However, both map and filter are special cases of fold, which makes fold the fundamental function of structured recursion.
Foldable generalizes folding over arbitrary data structure and raises the concept of folding to type level. Foldable generalizes structured recursion in Haskell from lists to container types.
Download
Haskell Design Patterns by Ryan Lemmer.azw3
Haskell Design Patterns by Ryan Lemmer.epub
Haskell Design Patterns by Ryan Lemmer.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Modelling of Convective Heat and Mass Transfer in Rotating Flows by Igor V. Shevchuk(6203)
Weapons of Math Destruction by Cathy O'Neil(5779)
Factfulness: Ten Reasons We're Wrong About the World – and Why Things Are Better Than You Think by Hans Rosling(4455)
Descartes' Error by Antonio Damasio(3139)
A Mind For Numbers: How to Excel at Math and Science (Even If You Flunked Algebra) by Barbara Oakley(3076)
Factfulness_Ten Reasons We're Wrong About the World_and Why Things Are Better Than You Think by Hans Rosling(3025)
TCP IP by Todd Lammle(2983)
Applied Predictive Modeling by Max Kuhn & Kjell Johnson(2859)
Fooled by Randomness: The Hidden Role of Chance in Life and in the Markets by Nassim Nicholas Taleb(2835)
The Tyranny of Metrics by Jerry Z. Muller(2819)
The Book of Numbers by Peter Bentley(2744)
The Great Unknown by Marcus du Sautoy(2516)
Once Upon an Algorithm by Martin Erwig(2457)
Easy Algebra Step-by-Step by Sandra Luna McCune(2435)
Lady Luck by Kristen Ashley(2386)
Practical Guide To Principal Component Methods in R (Multivariate Analysis Book 2) by Alboukadel Kassambara(2358)
Police Exams Prep 2018-2019 by Kaplan Test Prep(2334)
All Things Reconsidered by Bill Thompson III(2242)
Linear Time-Invariant Systems, Behaviors and Modules by Ulrich Oberst & Martin Scheicher & Ingrid Scheicher(2210)
