
Beginning Haskell
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Person
Content
2 - Contents [Seite 397]
3 - About the Author [Seite 407]
4 - About the Technical Reviewer [Seite 408]
5 - Acknowledgments [Seite 409]
6 - Introduction [Seite 5]
7 - Part 1: First Steps [Seite 6]
7.1 - Chapter 1: Going Functional [Seite 7]
7.1.1 - Why Haskell? [Seite 7]
7.1.1.1 - Why Pure Functional Programming? [Seite 8]
7.1.1.2 - Why Strong Static Typing? [Seite 9]
7.1.1.3 - The Haskell Ecosystem [Seite 10]
7.1.2 - The History of Haskell [Seite 10]
7.1.3 - Your Working Environment [Seite 10]
7.1.3.1 - Installing on Windows [Seite 11]
7.1.3.2 - Installing on Mac OS X [Seite 11]
7.1.3.3 - Installing on Linux [Seite 12]
7.1.3.4 - Installing on Linux from Source [Seite 12]
7.1.3.5 - Checking That the Installation Is Successful [Seite 13]
7.1.3.6 - Installing EclipseFP [Seite 13]
7.1.4 - Taking Your First Steps with GHCi [Seite 15]
7.1.5 - The Time Machine Store [Seite 16]
7.1.6 - Summary [Seite 17]
7.2 - Chapter 2: Declaring the Data Model [Seite 18]
7.2.1 - Working with Characters, Numbers, and Lists [Seite 18]
7.2.1.1 - Characters [Seite 18]
7.2.1.2 - Numbers [Seite 20]
7.2.1.3 - Strings [Seite 21]
7.2.1.4 - Lists [Seite 21]
7.2.1.5 - List Operations [Seite 22]
7.2.2 - Creating a New Project [Seite 25]
7.2.2.1 - Creating a Project from the Command Line [Seite 25]
7.2.2.2 - Creating a Project from EclipseFP [Seite 25]
7.2.2.3 - Understanding Modules [Seite 28]
7.2.3 - Defining Simple Functions [Seite 29]
7.2.3.1 - Creating a Simple Function [Seite 29]
7.2.3.2 - Specifying the Function's Type [Seite 30]
7.2.3.3 - Developing a Robust Example [Seite 30]
7.2.3.4 - Returning More Than One Value [Seite 32]
7.2.4 - Working with Data Types [Seite 33]
7.2.5 - Pattern Matching [Seite 36]
7.2.5.1 - Simple Patterns [Seite 36]
7.2.5.2 - Lists and Tuples [Seite 40]
7.2.5.3 - Guards [Seite 41]
7.2.5.4 - View Patterns [Seite 43]
7.2.6 - Records [Seite 44]
7.2.6.1 - Creation and Use [Seite 44]
7.2.6.2 - The Default Values Idiom [Seite 46]
7.2.7 - Summary [Seite 48]
7.3 - Chapter 3: Reusing Code Through Lists [Seite 49]
7.3.1 - Parametric Polymorphism [Seite 49]
7.3.2 - Functions As Parameters [Seite 52]
7.3.2.1 - Higher-Order Functions [Seite 52]
7.3.2.2 - Anonymous Functions [Seite 54]
7.3.2.3 - Partial Application of a Function [Seite 56]
7.3.3 - More on Modules [Seite 59]
7.3.3.1 - Module Imports [Seite 59]
7.3.3.2 - Smart Constructors and Views [Seite 61]
7.3.4 - Diving into Lists [Seite 63]
7.3.4.1 - Folds [Seite 63]
7.3.4.2 - Lists and Predicates [Seite 66]
7.3.4.3 - Lists Containing Tuples [Seite 71]
7.3.5 - List Comprehensions [Seite 72]
7.3.6 - Haskell Origami [Seite 75]
7.3.7 - Summary [Seite 78]
7.4 - Chapter 4: Using Containers and Type Classes [Seite 79]
7.4.1 - Using Packages [Seite 79]
7.4.1.1 - Managing Packages with Cabal and EclipseFP [Seite 79]
7.4.1.2 - Sandboxed Environments [Seite 84]
7.4.2 - Containers: Maps, Sets, Trees, Graphs [Seite 86]
7.4.2.1 - Maps [Seite 86]
7.4.2.2 - Sets [Seite 89]
7.4.2.3 - Trees [Seite 91]
7.4.2.4 - Graphs [Seite 92]
7.4.2.5 - Obtaining Help [Seite 94]
7.4.3 - Ad Hoc Polymorphism: Type Classes [Seite 96]
7.4.3.1 - Declaring Classes and Instances [Seite 96]
7.4.3.2 - Built-in Type Classes [Seite 99]
7.4.4 - Binary Tress for the Minimum Price [Seite 103]
7.4.4.1 - Step 1: Simple Binary Trees [Seite 103]
7.4.4.2 - Step 2: Polymorphic Binary Trees [Seite 104]
7.4.4.3 - Step 3: Binary Trees with Monoidal Cache [Seite 106]
7.4.5 - Container-Related Type Classes [Seite 108]
7.4.5.1 - Functors [Seite 108]
7.4.5.2 - Foldables [Seite 109]
7.4.6 - Summary [Seite 111]
7.5 - Chapter 5: Laziness and Infinite Structures [Seite 112]
7.5.1 - An Infinite Number of Time Machines [Seite 112]
7.5.2 - Lazy Evaluation Model [Seite 116]
7.5.2.1 - Understanding Evaluation in Haskell [Seite 116]
7.5.2.2 - Problems with Laziness [Seite 120]
7.5.2.3 - Pattern Matching and Laziness [Seite 122]
7.5.3 - Profiling with GHC [Seite 123]
7.5.4 - Strictness Annotations [Seite 128]
7.5.5 - Summary [Seite 130]
8 - Part 2: Data Mining [Seite 131]
8.1 - Chapter 6: Knowing Your Clients Using Monads [Seite 132]
8.1.1 - Data Mining [Seite 132]
8.1.1.1 - Implementing K-means [Seite 133]
8.1.1.2 - Lenses [Seite 137]
8.1.2 - Discovering Monads [Seite 143]
8.1.2.1 - Watching Out for Incomplete Data [Seite 143]
8.1.2.2 - Combinators for State [Seite 145]
8.1.2.3 - Dissecting the Combinators [Seite 147]
8.1.2.4 - do Notation [Seite 149]
8.1.2.5 - Monad Laws [Seite 152]
8.1.3 - Different Sorts of State [Seite 153]
8.1.3.1 - State and Lenses [Seite 153]
8.1.3.2 - Reader, Writer, and RWS [Seite 154]
8.1.3.3 - Mutable References with ST [Seite 158]
8.1.4 - Summary [Seite 159]
8.2 - Chapter 7: More Monads: Now for Recommendations [Seite 160]
8.2.1 - Returning More Than One Value [Seite 160]
8.2.1.1 - The List Monad [Seite 161]
8.2.1.2 - A New View Over Monads [Seite 162]
8.2.2 - Failures and Alternatives [Seite 163]
8.2.3 - Association Rules Learning [Seite 166]
8.2.3.1 - Flattening Values into Transactions [Seite 166]
8.2.3.2 - The Apriori Algorithm [Seite 168]
8.2.4 - Search Problems [Seite 171]
8.2.4.1 - Paths in a Graph [Seite 171]
8.2.4.2 - The Logic Monad [Seite 172]
8.2.5 - Monads and Lists Redux [Seite 174]
8.2.5.1 - Combining Values Under a Monad [Seite 174]
8.2.5.2 - Monad Comprehensions [Seite 177]
8.2.6 - Combining Monads [Seite 179]
8.2.6.1 - Monad Transformers [Seite 179]
8.2.6.2 - Monad Classes [Seite 182]
8.2.7 - Summary [Seite 184]
8.3 - Chapter 8: Working in Several Cores [Seite 185]
8.3.1 - Parallelism, Concurrency, and Distribution [Seite 185]
8.3.2 - The Par Monad [Seite 186]
8.3.2.1 - Futures [Seite 186]
8.3.2.2 - Dataflow Parallelism with IVars [Seite 188]
8.3.2.3 - Parallelizing the Apriori Algorithm [Seite 190]
8.3.3 - Software Transactional Memory [Seite 192]
8.3.3.1 - Concurrent Use of Resources [Seite 192]
8.3.3.2 - Atomic Transactions [Seite 194]
8.3.3.3 - Rolling Back Transactions [Seite 195]
8.3.3.4 - Producer-Consumer Queues [Seite 197]
8.3.4 - Cloud Haskell [Seite 198]
8.3.4.1 - Looking for Galaxies [Seite 198]
8.3.4.2 - Looking for Typed Galaxies [Seite 202]
8.3.4.3 - Extra Features [Seite 203]
8.3.5 - Summary [Seite 203]
9 - Part 3: Resource Handling [Seite 204]
9.1 - Chapter 9: Dealing with Files: IO and Conduit [Seite 205]
9.1.1 - Basic Input and Output [Seite 205]
9.1.2 - Randomness [Seite 209]
9.1.3 - Working with Files [Seite 211]
9.1.3.1 - Reading and Writing [Seite 211]
9.1.3.2 - Handling Files [Seite 213]
9.1.4 - Error Handling [Seite 214]
9.1.4.1 - Pure Errors [Seite 214]
9.1.4.2 - Catching Exceptions [Seite 217]
9.1.4.3 - Throwing Exceptions [Seite 220]
9.1.5 - Streaming Data with Conduit [Seite 221]
9.1.5.1 - Problems with Lazy Input/Output [Seite 221]
9.1.5.2 - Introducing Conduits [Seite 222]
9.1.5.3 - Accessing Files via Conduit [Seite 226]
9.1.6 - Looking Further Than Text Files [Seite 227]
9.1.6.1 - Basic Networking [Seite 227]
9.1.6.2 - Binary Serialization [Seite 229]
9.1.7 - Summary [Seite 230]
9.2 - Chapter 10: Building and Parsing Text [Seite 231]
9.2.1 - The Five Textual Data Types [Seite 231]
9.2.2 - Building as Fast as the Wind [Seite 235]
9.2.3 - Parsing with attoparsec [Seite 237]
9.2.4 - Introducing New Type Classes [Seite 242]
9.2.4.1 - Applicative [Seite 242]
9.2.4.2 - Functors, Applicatives, and Monads [Seite 244]
9.2.4.3 - Alternative [Seite 246]
9.2.4.4 - Traversable [Seite 247]
9.2.5 - Don't Overengineer: Just Use JSON [Seite 249]
9.2.6 - Summary [Seite 254]
9.3 - Chapter 11: Safe Database Access [Seite 255]
9.3.1 - Database Access Landscape [Seite 255]
9.3.1.1 - Abstracting Over Several DBMSs [Seite 256]
9.3.1.2 - Introducing Persistent and Esqueleto [Seite 256]
9.3.2 - Connection [Seite 257]
9.3.3 - Schemas and Migrations [Seite 258]
9.3.3.1 - Describing the Entities [Seite 259]
9.3.3.2 - Creating the Database [Seite 262]
9.3.4 - Queries [Seite 265]
9.3.4.1 - Queries by Identifier or Uniqueness [Seite 265]
9.3.4.2 - Selecting Several Entities [Seite 266]
9.3.4.3 - SQL Queries with Esqueleto [Seite 267]
9.3.5 - Insertions, Updates, and Deletions [Seite 270]
9.3.6 - Summary [Seite 272]
9.4 - Chapter 12: Web Applications [Seite 273]
9.4.1 - Haskell Web Ecosystem [Seite 273]
9.4.1.1 - Web Frameworks [Seite 273]
9.4.1.2 - Compilation to JavaScript [Seite 275]
9.4.2 - RESTful Structure [Seite 275]
9.4.3 - Back End with Scotty [Seite 276]
9.4.3.1 - Simple Skeleton [Seite 276]
9.4.3.2 - Showing Products from the Database [Seite 277]
9.4.3.3 - Inserting New Products Using Forms [Seite 281]
9.4.4 - Front End with Fay [Seite 285]
9.4.4.1 - Foreign Function Interface [Seite 286]
9.4.4.2 - Fay and jQuery [Seite 287]
9.4.5 - Summary [Seite 290]
10 - Part 4: Domain Specific Languages [Seite 291]
10.1 - Chapter 13: Strong Types for Describing Offers [Seite 292]
10.1.1 - Domain-Specific Languages [Seite 292]
10.1.1.1 - Embedding Your Language in Haskell [Seite 293]
10.1.1.2 - The Offers Language [Seite 294]
10.1.2 - Adding Safety to the Expression Language [Seite 296]
10.1.3 - Dependent Typing [Seite 299]
10.1.3.1 - Introducing Idris [Seite 300]
10.1.3.2 - Enforcing the Presents Rule in Idris [Seite 303]
10.1.4 - Type-Level Programming in Haskell [Seite 304]
10.1.4.1 - Two Styles of Programming [Seite 305]
10.1.4.2 - Representing Natural Numbers [Seite 305]
10.1.5 - Functional Dependencies [Seite 307]
10.1.5.1 - Categories of Products with FDs [Seite 307]
10.1.5.2 - Enforcing the Presents Rule with FDs [Seite 309]
10.1.6 - Type Families [Seite 312]
10.1.6.1 - Enforcing the Presents Rule with TFs [Seite 312]
10.1.6.2 - Categories of Products with TFs [Seite 314]
10.1.7 - Data Type Promotion and Singletons [Seite 318]
10.1.7.1 - A Further Refinement to the Presents Rule [Seite 318]
10.1.7.2 - Enforcing the Duration Rule [Seite 321]
10.1.8 - Summary [Seite 325]
10.2 - Chapter 14: Interpreting Offers with Attributes [Seite 327]
10.2.1 - Interpretations and Attribute Grammars [Seite 327]
10.2.1.1 - A Simple Interpretation [Seite 327]
10.2.1.2 - Introducing Attribute Grammars [Seite 328]
10.2.2 - Your First Attribute Grammar [Seite 329]
10.2.2.1 - Synthesizing the Result [Seite 329]
10.2.2.2 - Executing the Attribute Grammar [Seite 330]
10.2.3 - Integrating UUAGC in Your Package [Seite 331]
10.2.3.1 - Installing UUAGC [Seite 331]
10.2.3.2 - UUAGC and Cabal [Seite 332]
10.2.4 - Expressions Interpretation [Seite 334]
10.2.4.1 - Using an Attribute Grammar [Seite 334]
10.2.4.2 - Precomputing Some Values [Seite 336]
10.2.4.3 - A Different (Monadic) View [Seite 337]
10.2.5 - Offer Interpretations [Seite 339]
10.2.5.1 - Checking the Presents Rule [Seite 339]
10.2.5.2 - Showing an HTML Description [Seite 340]
10.2.6 - Origami Programming Over Any Data Type [Seite 344]
10.2.7 - Summary [Seite 346]
11 - Part 5: Engineering the Store [Seite 347]
11.1 - Chapter 15: Documenting, Testing, and Verifying [Seite 348]
11.1.1 - Documenting Binary Trees with Haddock [Seite 348]
11.1.2 - Unit Testing with HUnit [Seite 352]
11.1.2.1 - Declaring Tests in Cabal [Seite 352]
11.1.2.2 - Writing Unit Tests [Seite 354]
11.1.3 - Randomized Testing with QuickCheck [Seite 357]
11.1.3.1 - Testing List Properties [Seite 357]
11.1.3.2 - Testing Binary Tree Properties [Seite 358]
11.1.4 - Formal Verification with Idris [Seite 360]
11.1.5 - Summary [Seite 364]
11.2 - Chapter 16: Architecting Your Application [Seite 365]
11.2.1 - Design Patterns and Functional Programming [Seite 365]
11.2.2 - Medium-Level Guidelines [Seite 366]
11.2.2.1 - Use Higher-Order Combinators [Seite 366]
11.2.2.2 - Refactor [Seite 367]
11.2.2.3 - Use Type Classes Wisely [Seite 367]
11.2.2.4 - Enforce Invariants via the Type System [Seite 367]
11.2.2.5 - Stay (as) Pure and Polymorphic (as Possible) [Seite 367]
11.2.3 - Tools [Seite 368]
11.2.3.1 - Project and Dependency Management [Seite 368]
11.2.3.2 - Code Style [Seite 368]
11.2.3.3 - Documentation [Seite 369]
11.2.3.4 - Test and Verification [Seite 369]
11.2.3.5 - Benchmarking [Seite 369]
11.2.3.6 - Profiling [Seite 369]
11.2.3.7 - Coverage [Seite 369]
11.2.3.8 - Remote Monitoring [Seite 370]
11.2.4 - Projects [Seite 370]
11.2.4.1 - Data Mining Library [Seite 370]
11.2.4.2 - Store Network Client [Seite 371]
11.2.4.3 - Administration Interface and Tetris [Seite 376]
11.2.4.4 - Roll Your Own Monad [Seite 377]
11.2.5 - Summary [Seite 379]
11.3 - Appendix A: Looking Further [Seite 380]
11.3.1 - Haskell Resources [Seite 380]
11.3.1.1 - Other Functional Languages [Seite 381]
11.4 - Appendix B: Time Traveling with Haskell [Seite 382]
12 - Index [Seite 384]
System requirements
File format: PDF
Copy protection: Watermark-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Use the free software Adobe Reader, Adobe Digital Editions, or any other PDF viewer of your choice (see eBook Help).
- Tablet/Smartphone (Android; iOS): Install the free app Adobe Digital Editions or another reading app for eBooks, e.g., PocketBook (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Watermark-DRM, a „soft” copy protection. This means that there are no technical restrictions to prevent illegal distribution. However, there is a personalised watermark embedded in the eBook that can be used to identify the purchaser of the eBook in the event of misuse and to provide evidence for legal purposes.
For more information, see our eBook Help page.