Haskell is most likely quite different from any language you've ever used before. Compared to the usual set of concepts in a programmer's mental toolbox, functional programming offers us a profoundly different way to think about software.
In Haskell, we deemphasize code that modifies data. Instead, we focus on functions that take immutable values as input and produce new values as output. Given the same inputs, these functions always return the same results. This is a core idea behind functional programming.
书 名: 真实世界的Haskell
作 者：沙利文 戈尔 斯图尔特
沙利文(Bryan O'sullivan) is an Irish hacker and writer who likes distributed systems, open source software, and programming languages. He was a member of the initial design team for the Jini network service architecture (subsequently open sourced as Apache River). He has made significant contributions to, and written a book about, the popular Mercurial revision control system. He lives in San Francisco with his wife and sons. Whenever he can, he runs off to climb rocks.
斯图尔特(Don Stewart) is an Australian hacker, currently completing his computer science doctorate at the University of New South Wales, Sydney. Don has been involved in a diverse range of Haskell projects, including practical libraries such as Data.ByteString and Data.Binary, as well applying the Haskell philosophy to real world applications, including compilers, linkers, text editors, network servers and systems software. His recent work has focused on optimising Haskell for high-performance scenarios, using techniques from term rewriting. He is the current editor of the Haskell Weekly News.........
1. Getting Started
Your Haskell Environment
Getting Started with ghci, the Interpreter
Basic Interaction: Using ghci as a Calculator
An Arithmetic Quirk: Writing Negative Numbers
Boolean Logic, Operators, and Value Comparisons
Operator Precedence and Associativity
Undefined Values, and Introducing Variables
Dealing with Precedence and Associativity Rules
Command-Line Editing in ghci
Operators on Lists
Strings and Characters
First Steps with Types
A Simple Program
2. Types and Functions
Why Care About Types?
Haskell’s Type System
What to Expect from the Type System
Some Common Basic Types
Useful Composite Data Types: Lists and Tuples
Functions over Lists and Tuples
Passing an Expression to a Function
Function Types and Purity