: Alejandro Serrano Mena
: Practical Haskell A Real World Guide to Programming
: Apress
: 9781484244807
: 2
: CHF 41.70
:
: Programmiersprachen
: English
: 600
: Wasserzeichen/DRM
: PC/MAC/eReader/Tablet
: PDF

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 book contains excellent coverage of the Haskell ecosystem and supporting tools, include Cabal and Stack for managing projects, HUnit and QuickCheck for software testing, the Spock framework for developing web applications, Persistent and Esqueleto for database access, and parallel and distributed programming libraries.

You'll 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, andPractical Haskell takes advantage of this to show off the language and what it can do.

What You Will Learn

    < i>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
  • Underst nd monads and monad transformers
  • Prof ciently 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. 

br>



Alejandro Serrano Mena is working towards his PhD thesis in the Software Technology group in Utrecht University. He is passionate about functional programming, and has been coding Haskell for personal and professional projects for more than five years. During his college years he was active in an association promoting functional languages among students, giving talks and helping programmers get started in the functional paradigm. In 2011 he took part in the Google Summer of Code program, enhancing the Haskell plug-in for the popular development environment Eclipse. His current position involves research for enhancing the way in which developers get feedback and interact with strong type systems such as Haskell's.
Table of Contents5
About the Author15
About the Technical Reviewer16
Acknowledgments17
Introduction18
Part I: First Steps20
Chapter 1: Going Functional21
Why Haskell?21
Why Pure Functional Programming?22
Why Strong Static Typing?24
The Haskell Ecosystem25
The History of Haskell26
Your Working Environment26
Installing on Windows or Mac OS X27
Installing on Linux27
Installing on Linux from Source28
First Steps with GHCi29
The Time Machine Store31
Summary32
Chapter 2: Declaring the Data Model34
Characters, Numbers, and Lists34
Characters35
Numbers36
Strings38
Lists39
Creating a New Project44
Creating a Project with Cabal44
Creating a Project with Stack46
Understanding Modules48
Cabal and Stack50
Defining Simple Functions50
Creating a Simple Function51
Specifying the Function s Type51
Developing a Robust Example52
Returning More Than One Value55
Working with Data Types57
Pattern Matching61
Simple Patterns61
Lists and Tuples66
Guards68
View Patterns71
Records73
Creation and Use73
The Default Values Idiom77
Summary79
Chapter 3: Increasing Code Reuse80
Parametric Polymorphism81
Functions As Parameters84
Higher-Order Functions85
Anonymous Functions87
Partial Application of a Function90
More on Modules94
Module Imports94
Smart Constructors and Views96
Diving into Lists99
Folds100
Lists and Predicates104
Lists Containing Tuples112
List Comprehensions113
Haskell Origami118
Summary123
Chapter 4: Using Containers and Type Classes125
Using Packages126
Managing Dependencies127
Building Packages129
Building Packages with Cabal129
Building Packages with Stack131
Obtaining Help134
Containers: Maps, Sets, Trees, Graphs134
Maps135
Sets140
Trees142
Graphs145
Ad Hoc Polymorphism: Type Classes148
Declaring Classes and Instances149
Built-in Type Classes153
Binary Trees for the Minimum Price159
Step 1: Simple Binary Trees159
Step 2: Polymorphic Binary Trees161
Step 3: Binary Trees with Monoidal Cache163
Container-Related Type Classes166
Functors166
Foldables169
Summary171
Chapter 5: Laziness and Infinite Structures172
An Infinite Number of Time Machines173
Lazy Evaluation Model178
Understandin