Muutke küpsiste eelistusi

Practical Haskell: A Real-World Guide to Functional Programming 3rd ed. [Pehme köide]

  • Formaat: Paperback / softback, 595 pages, kõrgus x laius: 254x178 mm, kaal: 1163 g, 33 Illustrations, black and white; XXII, 595 p. 33 illus., 1 Paperback / softback
  • Ilmumisaeg: 25-Sep-2022
  • Kirjastus: APress
  • ISBN-10: 1484285808
  • ISBN-13: 9781484285800
  • Pehme köide
  • Hind: 57,96 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Tavahind: 68,19 €
  • Säästad 15%
  • Raamatu kohalejõudmiseks kirjastusest kulub orienteeruvalt 2-4 nädalat
  • Kogus:
  • Lisa ostukorvi
  • Tasuta tarne
  • Tellimisaeg 2-4 nädalat
  • Lisa soovinimekirja
  • Formaat: Paperback / softback, 595 pages, kõrgus x laius: 254x178 mm, kaal: 1163 g, 33 Illustrations, black and white; XXII, 595 p. 33 illus., 1 Paperback / softback
  • Ilmumisaeg: 25-Sep-2022
  • Kirjastus: APress
  • ISBN-10: 1484285808
  • ISBN-13: 9781484285800
Get a practical, hands-on introduction to the Haskell language, its libraries and environment, and to the functional programming paradigm that is fast growing in importance in the software industry. This updated edition includes more modern treatment of Haskell's web framework and APIs.

This book contains excellent coverage of the Haskell ecosystem and supporting tools, including Cabal and Stack for managing projects, HUnit and QuickCheck for software testing, WAI and Elm to develop the back end and front end of web applications, Persistent and Esqueleto for database access, and parallel and distributed programming libraries.

Youll see how functional programming is gathering momentum, allowing you to express yourself in a more concise way, reducing boilerplate, and increasing the safety of your code. Haskell is an elegant and noise-free pure functional language with a long history, having a huge number of library contributors and an active community. 

This makes Haskell the best tool for both learning and applying functional programming, and Practical Haskell, Third Edition takes advantage of this to show off the language and what it can do.  Free source code available on the Apress GitHub page for this book.

What You Will Learn











Get started programming with Haskell

Examine the different parts of the language

Gain an overview of the most important libraries and tools in the Haskell ecosystem

Apply functional patterns in real-world scenarios

Understand monads and monad transformers

Proficiently use laziness and resource management







Who This Book Is For

Experienced programmers who may be new to the Haskell programming language. However, some prior exposure to Haskell is recommended.
About the Author xv
About the Technical Reviewer xvii
Acknowledgments xix
Introduction xxi
Part I First Steps
1(182)
Chapter 1 Going Functional
3(12)
Why Haskell?
3(1)
Why Pure Functional Programming?
4(2)
Why Strong Static Typing?
6(1)
The Haskell Ecosystem
7(1)
The History of Haskell
8(1)
Your Working Environment
9(1)
First Steps withGHCi
10(3)
The Time Machine Store
13(1)
Summary
14(1)
Chapter 2 Declaring the Data Model
15(48)
Characters, Numbers, and Lists
15(1)
Characters
16(1)
Numbers
17(2)
Strings
19(1)
Lists
20(5)
Creating a New Project
25(1)
Creating a Project with Cabal
25(2)
Creating a Project with Stack
27(2)
Understanding Modules
29(2)
Cabal and Stack
31(1)
Defining Simple Functions
32(1)
Creating a Simple Function
32(1)
Specifying the Function's Type
33(1)
Developing a Robust Example
33(3)
Returning More Than One Value
36(2)
Working with Data Types
38(5)
Pattern Matching
43(11)
Records
54(6)
Summary
60(3)
Chapter 3 Increasing Code Reuse
63(44)
Parametric Polymorphism
64(3)
Functions As Parameters
67(1)
Higher-Order Functions
68(2)
Anonymous Functions
70(2)
Partial Application of a Function
72(4)
More on Modules
76(1)
Module Imports
77(2)
Smart Constructors and Views
79(3)
Diving into Lists
82(1)
Folds
82(5)
Lists and Predicates
87(7)
Lists Containing Tuples
94(2)
List Comprehensions
96(5)
Haskell Origami
101(5)
Summary
106(1)
Chapter 4 Using Containers and Type Classes
107(48)
Using Packages
107(1)
Managing Dependencies
108(3)
Building Packages
111(5)
Obtaining Help
116(1)
Containers: Maps, Sets, Trees, Graphs
116(1)
Maps
117(5)
Sets
122(2)
Trees
124(3)
Graphs
127(3)
Ad Hoc Polymorphism: Type Classes
130(1)
Declaring Classes and Instances
130(5)
Built-in Type Classes
135(6)
Binary Trees for the Minimum Price
141(1)
Step 1 Simple Binary Trees
141(2)
Step 2 Polymorphic Binary Trees
143(2)
Step 3 Binary Trees with Monoidal Cache
145(3)
Container-Related Type Classes
148(1)
Functors
148(3)
Foldables
151(2)
Summary
153(2)
Chapter 5 Laziness and Infinite Structures
155(28)
An Infinite Number of Time Machines
156(5)
Lazy Evaluation Model-
161(1)
Understanding Evaluation in Haskell
161(5)
Problems with Laziness
166(3)
Pattern Matching and Laziness
169(3)
Profiling with GHC
172(5)
Strictness Annotations
177(3)
Summary
180(3)
Part II Data Mining
183(116)
Chapter 6 Knowing Your Clients Using Monads
185(44)
Data Mining
186(1)
Implementing K-means
186(7)
Lenses
193(9)
Discovering Monads
202(1)
Watching Out for Incomplete Data
202(3)
Combinators for State
205(4)
Dissecting the Combinators
209(2)
Do Notation
211(4)
Monad Laws
215(2)
Different Sorts of State
217(1)
State and Lenses
217(2)
Reader, Writer, and RWS
219(5)
Mutable References with ST
224(2)
Summary
226(3)
Chapter 7 More Monads: Now for Recommendations
229(40)
Returning More Than One Value
230(1)
The List Monad
230(2)
A New View over Monads
232(1)
Failures and Alternatives
233(4)
Association Rule Learning
237(1)
Flattening Values into Transactions
238(3)
The Apriori Algorithm
241(5)
Search Problems
246(1)
Paths in a Graph
247(1)
The Logic Monad
248(3)
Monads and Lists, Redux
251(1)
Combining Values Under a Monad
252(3)
Monad Comprehensions
255(4)
Combining Monads
259(1)
Monad Transformers
260(4)
Monad Classes
264(3)
Summary
267(2)
Chapter 8 Working in Several Cores
269(30)
Parallelism, Concurrency, and Distribution
269(2)
The Par Monad
271(1)
Futures
272(3)
Dataflow Parallelism with IVars
275(2)
Parallelizing the Apriori Algorithm
277(3)
Software Transactional Memory
280(1)
Concurrent Use of Resources
280(3)
Atomic Transactions
283(3)
Rolling Back Transactions
286(2)
Producer-Consumer Queues
288(1)
Single-Process Queues
289(2)
Message Queues Using AMQP
291(2)
AMQP in Haskell
293(4)
Summary
297(2)
Part III Resource Handling
299(138)
Chapter 9 Dealing with Files: 10 and Conduit
301(42)
Basic Input and Output
301(6)
Randomness
307(3)
Working with Files
310(1)
Reading and Writing
310(3)
Handling Files
313(2)
Error Handling
315(1)
Pure Errors
316(3)
Catching Exceptions
319(5)
Throwing Exceptions
324(2)
Streaming Data with Conduit
326(1)
Problems with Lazy Input/Output
326(2)
Introducing Conduits
328(4)
Accessing Files via Conduit
332(2)
Looking Further Than Text Files -
334(1)
Basic Networking
335(2)
Binary Serialization
337(2)
Comma-Separated Values
339(2)
Summary
341(2)
Chapter 10 Building and Parsing Text
343(36)
The Five Textual Data Types
343(5)
Building As Fast As the Wind
348(5)
Parsing with attoparsec
353(7)
Introducing New Type Classes
360(1)
Applicative
361(2)
Functors, Applicatives, and Monads
363(3)
Alternative
366(1)
Traversable
367(3)
Don't Overengineer: Just Use JSON
370(8)
Summary
378(1)
Chapter 11 Safe Database Access
379(30)
Database Access Landscape
379(1)
Abstracting Over Several DBMSs
380(1)
Introducing Persistent and Esqueleto
381(1)
Connection
382(3)
Schemas and Migrations
385(1)
Describing the Entities
386(5)
Creating the Database
391(4)
Queries
395(1)
Queries by Identifier or Uniqueness
396(1)
Selecting Several Entities
397(3)
SQL Queries with Esqueleto
400(4)
Insertions, Updates, and Deletions
404(4)
Summary
408(1)
Chapter 12 Web Applications
409(28)
Haskell Web Ecosystem
409(1)
Web Applications
410(2)
Compilation to JavaScript
412(1)
REST ful Structure
413(1)
Back End with WAI
414(1)
Simple Skeleton
414(3)
Showing Products from the Database
417(5)
Inserting New Products Using Forms
422(5)
Front End with Elm
427(5)
Retrieving Products
432(4)
Summary
436(1)
Part IV Domain-Specific Languages
437(82)
Chapter 13 Strong Types for Describing Offers
439(44)
Domain-Specific Languages
439(1)
Embedding Your Language in Haskell
440(3)
The Offers Language
443(3)
Adding Safety to the Expression Language
446(4)
Type-Level Programming
450(1)
Two Styles of Programming
451(1)
Representing Natural Numbers
452(2)
Functional Dependencies
454(1)
Categories of Products with FDs
454(4)
Vectors Using FDs
458(3)
Enforcing the Presents Rule with FDs
461(2)
Type Families
463(1)
Vectors Using TFs
464(1)
Enforcing the Presents Rule with TFs
465(1)
Categories of Products with TFs
466(6)
Data Type Promotion and Singletons
472(1)
A Further Refinement to the Presents Rule
472(2)
Cooking with Singletons
474(2)
Enforcing the Duration Rule
476(6)
Summary
482(1)
Chapter 14 Interpreting Offers with Attributes
483(36)
Interpretations and Attribute Grammars
484(1)
A Simple Interpretation
484(1)
Introducing Attribute Grammars
484(3)
Your First Attribute Grammar
487(1)
Synthesizing the Result
488(2)
Integrating UUAGC in Your Package
490(2)
Executing the Attribute Grammar
492(1)
Expression Interpretation
493(1)
Using an Attribute Grammar
494(3)
Precomputing Some Values
497(2)
A Different (Monadic) View
499(2)
Offer Interpretations
501(1)
Checking the Presents Rule
501(2)
Showing an HTML Description
503(6)
Programming with Data Types
509(1)
Origami Programming over Any Data Type
509(3)
Data Type-Generic Programming
512(4)
Summary
516(3)
Part V Engineering the Store
519(54)
Chapter 15 Documenting, Testing, and Verifying
521(24)
Documenting Binary Trees with Haddock
522(4)
Unit Testing with HUnit
526(1)
Declaring Tests in Cabal
527(1)
Writing Unit Tests
528(4)
Randomized Testing with QuickCheck
532(1)
Testing List Properties
533(1)
Testing Binary Tree Properties
534(3)
Formal Verification with LiquidHaskell
537(4)
Describing Binary Search Trees
541(2)
Summary
543(2)
Chapter 16 Architecting Your Application
545(20)
Tools
545(1)
Project and Dependency Management
546(1)
Code Style
546(1)
Documentation
547(1)
Test and Verification
547(1)
Benchmarking
547(1)
Profiling
548(1)
Coverage
548(1)
Remote Monitoring
548(1)
Design Patterns and Functional Programming
549(2)
Medium-Level Guidelines
551(1)
Use Higher-Order Combinators
551(1)
Ref actor
551(1)
Use Type Classes Wisely
551(1)
Enforce Invariants via the Type System
552(1)
Stay (As) Pure and Polymorphic (As Possible)
552(1)
Patterns with Monads
553(1)
Summary of Monads
553(7)
Restrictive Monad Classes
560(1)
Roll Your Own Monad
561(3)
Summary
564(1)
Chapter 17 Looking Further
565(8)
Projects
565(1)
Data Mining Library
566(2)
Store Network Client
568(1)
Administration Interface and Tetris
569(1)
Additional Haskell Resources
570(1)
Other Functional Languages
571(2)
Appendix A Time Travelling with Haskell 573(4)
Index 577
Alejandro Serrano Mena has more than a decade of experience as a developer, trainer, and researcher in functional programming, with an emphasis on Haskell and related languages. He holds a Ph.D. from Utrecht University on the topic of error message customization in compilers. He's an active member of the community, maintaining a few open-source projects, writing books about Haskell, and collaborating on podcasts and conferences.