Haskell: the craft of functional programming
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Harlow [u.a.]
Addison-Wesley
2011
|
Ausgabe: | 3. ed. |
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | XXII, 585 S. Ill., graph. Darst. |
ISBN: | 9780201882957 0201882957 |
Internformat
MARC
LEADER | 00000nam a2200000zc 4500 | ||
---|---|---|---|
001 | BV037280430 | ||
003 | DE-604 | ||
005 | 20170329 | ||
007 | t | ||
008 | 110315s2011 ad|| |||| 00||| eng d | ||
020 | |a 9780201882957 |c (pbk.) £34.99 |9 978-0-201-88295-7 | ||
020 | |a 0201882957 |c (pbk.) £34.99 |9 0-201-88295-7 | ||
035 | |a (OCoLC)711861961 | ||
035 | |a (DE-599)HBZHT016723749 | ||
040 | |a DE-604 |b ger | ||
041 | 0 | |a eng | |
049 | |a DE-91G |a DE-739 |a DE-M347 |a DE-83 |a DE-473 | ||
082 | 0 | |a 005.133 |2 22 | |
084 | |a ST 240 |0 (DE-625)143625: |2 rvk | ||
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
084 | |a DAT 544f |2 stub | ||
100 | 1 | |a Thompson, Simon |e Verfasser |4 aut | |
245 | 1 | 0 | |a Haskell |b the craft of functional programming |c Simon Thompson |
250 | |a 3. ed. | ||
264 | 1 | |a Harlow [u.a.] |b Addison-Wesley |c 2011 | |
300 | |a XXII, 585 S. |b Ill., graph. Darst. | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
650 | 0 | 7 | |a HASKELL |0 (DE-588)4318275-6 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Funktionale Programmierung |0 (DE-588)4198740-8 |2 gnd |9 rswk-swf |
653 | |a Haskell (Computer program language) | ||
689 | 0 | 0 | |a HASKELL |0 (DE-588)4318275-6 |D s |
689 | 0 | 1 | |a Funktionale Programmierung |0 (DE-588)4198740-8 |D s |
689 | 0 | |5 DE-604 | |
856 | 4 | 2 | |m Digitalisierung UB Passau |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=021193242&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-021193242 |
Datensatz im Suchindex
_version_ | 1804143909615435776 |
---|---|
adam_text | Contents
Preface
xiii
1
Introducing functional programming
1
1.1
Computers and modelling
......................................... 2
1.2
What is a function?
............................................... 3
1.3
Pictures and functions
............................................ 4
1.4
Types
........................................................... 5
1.5
The Haskell programming language
................................ 7
1.6
Expressions and evaluation
........................................ 8
1.7
Definitions
....................................................... 9
1.8
Function definitions
............................................. 11
1.9
Types and functional programming
................................ 14
1.10
Calculation and evaluation
....................................... 15
1.11
The essence of Haskell programming
.............................. 16
1.12
Domain-specific languages
....................................... 17
1.13
Two models of Pictures
........................................ 18
1.14
Tests, properties and proofs
...................................... 22
2
Getting started with Haskell and GHCi
27
2.1
A first Haskell program
.......................................... 27
2.2
Using Haskell in practice
........................................ 28
2.3
Using GHCi
.................................................... 29
2.4
The standard prelude and the Haskell libraries
...................... 33
2.5
Modules
........................................................ 34
2.6
A second example: pictures
...................................... 35
2.7
Errors and error messages
........................................ 38
3
Basic types and definitions
41
3.1
The Booleans: Bool
.............................................
Л2
3.2
The integers: Integer and
Int
........................,,,...,.,,. 45
3.3
Overloading
.................................................,,, 47
3.4
Guards
......................................................... 48
VII
viii CONTENTS
3.5
Characters and strings
........................................... 52
3.6
Floating-point numbers: Float
................................... 56
3.7
Syntax
......................................................... 60
4
Designing and writing programs
67
4.1
Where do I start? Designing a program in Haskell
.................. 67
4.2
Solving a problem in steps: local definitions
....................... 72
4.3
Defining types for ourselves: enumerated types
..................... 78
4.4
Recursion
...................................................... 81
4.5
Primitive recursion in practice
.................................... 84
4.6
Extended exercise: pictures
....................................... 87
4.7
General forms of recursion
....................................... 89
4.8
Program testing
................................................. 91
5
Data types, tuples and lists
97
5.1
Introducing tuples and lists
....................................... 97
5.2
Tuple types
.................................................... 100
5.3
Introducing algebraic types
..................................... 103
5.4
Our approach to lists
........................................... 109
5.5
Lists in Haskell
................................................ 109
5.6
List comprehensions
...........................................
Ill
5.7
A library database
.............................................. 116
6
Programming with lists
123
6.1
Generic functions: polymorphism
................................ 123
6.2
Haskell list functions in the Prelude
............................ 126
6.3
Finding your way around the Haskell libraries
.................... 129
6.4
The Picture example: implementation
.......................... 135
6.5
Extended exercise: alternative implementations of pictures
......... 140
6.6
Extended exercise: positioned pictures
........................... 144
6.7
Extended exercise: supermarket billing
........................... 147
6.8
Extended exercise: cards and card games
......................... 152
7
Defining functions over lists
155
7.1
Pattern matching revisited
....................................... 155
7.2
Lists and list patterns
........................................... 157
7.3
Primitive recursion over lists
.................................... 160
7.4
Finding primitive recursive definitions
........................... 161
7.5
General recursions over lists
.................................... 167
7.6
Example: text processing
....................................... 170
8
Playing the game: I/O in Haskell
177
8.1
Rock
-
Paper
-
Scissors: strategies
............................... 177
8.2
Why is I/O an issue?
........................................... 181
8.3
The basics of input/output
....................................... 182
8.4
The do notation
................................................ 185
CONTENTS ix
8.5
Loops and recursion
............................................ 189
8.6
Rock
-
Paper
-
Scissors: playing the game
........................ 191
9
Reasoning about programs
195
9.1
Understanding definitions
....................................... 196
9.2
Testing and proof
.............................................. 197
9.3
Definedness, termination and finiteness
........................... 199
9.4
A little logic
................................................... 200
9.5
Induction
...................................................... 201
9.6
Further examples of proofs by induction
.......................... 205
9.7
Generalizing the proof goal
..................................... 209
10
Generalization: patterns of computation
213
10.1
Patterns of computation over lists
................................ 214
10.2
Higher-order functions: functions as arguments
................... 216
10.3
Folding and primitive recursion
.................................. 221
10.4
Generalizing: splitting up lists
................................... 7.26
10.5
Case studies revisited
..................................,........ 7,27
11
Higher-order functions
231
11.1
Operators: function composition and application
.................. 232
11.2
Expressions for functions: lambda abstractions
.................... 235
11.3
Partial application
.............................................. 239
11.4
Under the hood: curried functions
................................ 242
11.5
Defining higher-order functions
................................. 247
11.6
Verification and general functions
................................ 253
12
Developing higher-order programs
263
12.1
Revisiting the Picture example
................................. 263
12.2
Functions as data: strategy combinators
.......................... 266
12.3
Functions as data: recognizing regular expressions
................. 269
12.4
Case studies: functions as data
................................... 272
12.5
Example: creating an index
..................................... 275
12.6
Development in practice
........................................ 281
12.7
Understanding programs
........................................ 284
13
Overloading, type classes and type checking
287
13.1
Why overloading?
.............................................. 287
13.2
Introducing classes
............................................. 288
13.3
Signatures and instances
........................................ 292
13.4
A tour of the built-in Haskell classes
............................. 299
13.5
Type checking and type inference: an overview
.............,..... 308
13.6
Monomorphic type checking
.................................... 309
13.7
Polymorphic type checking
..................................... 312
13.8
Type checking and classes
...................................... 320
X
CONTENTS
14
Algebraic types
323
14.1
Algebraic type definitions revisited
.............................. 324
14.2
Recursive algebraic types
....................................... 326
14.3
Polymorphic algebraic types
.................................... 333
14.4
Modelling program errors
....................................... 337
14.5
Design with algebraic data types
................................. 341
14.6
Algebraic types and type classes
................................. 345
14.7
Reasoning about algebraic types
................................. 350
15
Case study: Huffman codes
357
15.1
Modules in Haskell
............................................. 357
15.2
Modular design
................................................ 361
15.3
Coding and decoding
........................................... 362
15.4
Implementation
-
1
............................................. 364
15.5
Building Huffman trees
......................................... 367
15.6
Design
........................................................ 368
15.7
Implementation
-
II
............................................ 369
16
Abstract data types
377
16.1
Type representations
............................................ 377
16.2
The Haskell abstract data type mechanism
........................ 379
16.3
Queues
........................................................ 383
16.4
Design
........................................................ 386
16.5
Simulation
.................................................... 388
16.6
Implementing the simulation
.................................... 390
16.7
Search trees
................................................... 394
16.8
Sets
........................................................... 400
16.9
Relations and graphs
........................................... 405
16.10
Commentary
.................................................. 413
17
Lazy programming
415
17.1
Lazy evaluation
................................................ 416
17.2
Calculation rules and lazy evaluation
............................. 418
17.3
List comprehensions revisited
................................... 421
17.4
Data-directed programming
..................................... 428
17.5
Case study, parsing expressions
................................. 432
17.6
Infinite lists
.................................................... 442
17.7
Why infinite lists?
.............................................. 447
17.8
Case study: simulation
.......................................... 450
17.9
Proof revisited
................................................. 452
18
Programming with monads
459
18.1
I/O programming
.............................................. 459
18.2
Further I/O
.................................................... 462
18.3
The calculator
................................................. 465
18.4
The do notation revisited
....................................... 468
CONTENTS
ХІ
18.5
Monads: languages for functional programming
................... 469
18.6
Example: monadic computation over trees
........................ 476
19
Domain-specific languages
483
19.1
Programming languages everywhere
............................. 483
19.2
Why DSLs in Haskell?
......................................... 486
19.3
Shallow and deep embeddings
................................... 487
19.4
A DSL for regular expressions
................................... 490
19.5
Monadic DSLs
................................................. 495
19.6
DSLs for computation: generating data in QuickCheck
............. 498
19.7
Taking it further
............................................... 503
20
Time and space behaviour
505
20.1
Complexity of functions
........................................ 505
20.2
The complexity of calculations
.................................. 509
20.3
Implementations of sets
......................................... 513
20.4
Space behaviour
............................................... 514
20.5
Folding revisited
............................................... 517
20.6
Avoiding
recomputation
:
memoization
........................... 523
21
Conclusion
529
Appendices
A Functional, imperative and OO programming
535
В
Glossary
543
С
Haskell operators
551
D
Haskell practicalities
553
E GHCi
errors
555
F
Project ideas
561
Bibliography
567
|
any_adam_object | 1 |
author | Thompson, Simon |
author_facet | Thompson, Simon |
author_role | aut |
author_sort | Thompson, Simon |
author_variant | s t st |
building | Verbundindex |
bvnumber | BV037280430 |
classification_rvk | ST 240 ST 250 |
classification_tum | DAT 544f |
ctrlnum | (OCoLC)711861961 (DE-599)HBZHT016723749 |
dewey-full | 005.133 |
dewey-hundreds | 000 - Computer science, information, general works |
dewey-ones | 005 - Computer programming, programs, data, security |
dewey-raw | 005.133 |
dewey-search | 005.133 |
dewey-sort | 15.133 |
dewey-tens | 000 - Computer science, information, general works |
discipline | Informatik |
edition | 3. ed. |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01579nam a2200409zc 4500</leader><controlfield tag="001">BV037280430</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20170329 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">110315s2011 ad|| |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9780201882957</subfield><subfield code="c">(pbk.) £34.99</subfield><subfield code="9">978-0-201-88295-7</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">0201882957</subfield><subfield code="c">(pbk.) £34.99</subfield><subfield code="9">0-201-88295-7</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)711861961</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)HBZHT016723749</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-91G</subfield><subfield code="a">DE-739</subfield><subfield code="a">DE-M347</subfield><subfield code="a">DE-83</subfield><subfield code="a">DE-473</subfield></datafield><datafield tag="082" ind1="0" ind2=" "><subfield code="a">005.133</subfield><subfield code="2">22</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 240</subfield><subfield code="0">(DE-625)143625:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 250</subfield><subfield code="0">(DE-625)143626:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">DAT 544f</subfield><subfield code="2">stub</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Thompson, Simon</subfield><subfield code="e">Verfasser</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Haskell</subfield><subfield code="b">the craft of functional programming</subfield><subfield code="c">Simon Thompson</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">3. ed.</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Harlow [u.a.]</subfield><subfield code="b">Addison-Wesley</subfield><subfield code="c">2011</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XXII, 585 S.</subfield><subfield code="b">Ill., graph. Darst.</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">HASKELL</subfield><subfield code="0">(DE-588)4318275-6</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Funktionale Programmierung</subfield><subfield code="0">(DE-588)4198740-8</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="653" ind1=" " ind2=" "><subfield code="a">Haskell (Computer program language)</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">HASKELL</subfield><subfield code="0">(DE-588)4318275-6</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="1"><subfield code="a">Funktionale Programmierung</subfield><subfield code="0">(DE-588)4198740-8</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Passau</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=021193242&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-021193242</subfield></datafield></record></collection> |
id | DE-604.BV037280430 |
illustrated | Illustrated |
indexdate | 2024-07-09T22:55:09Z |
institution | BVB |
isbn | 9780201882957 0201882957 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-021193242 |
oclc_num | 711861961 |
open_access_boolean | |
owner | DE-91G DE-BY-TUM DE-739 DE-M347 DE-83 DE-473 DE-BY-UBG |
owner_facet | DE-91G DE-BY-TUM DE-739 DE-M347 DE-83 DE-473 DE-BY-UBG |
physical | XXII, 585 S. Ill., graph. Darst. |
publishDate | 2011 |
publishDateSearch | 2011 |
publishDateSort | 2011 |
publisher | Addison-Wesley |
record_format | marc |
spelling | Thompson, Simon Verfasser aut Haskell the craft of functional programming Simon Thompson 3. ed. Harlow [u.a.] Addison-Wesley 2011 XXII, 585 S. Ill., graph. Darst. txt rdacontent n rdamedia nc rdacarrier HASKELL (DE-588)4318275-6 gnd rswk-swf Funktionale Programmierung (DE-588)4198740-8 gnd rswk-swf Haskell (Computer program language) HASKELL (DE-588)4318275-6 s Funktionale Programmierung (DE-588)4198740-8 s DE-604 Digitalisierung UB Passau application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=021193242&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Thompson, Simon Haskell the craft of functional programming HASKELL (DE-588)4318275-6 gnd Funktionale Programmierung (DE-588)4198740-8 gnd |
subject_GND | (DE-588)4318275-6 (DE-588)4198740-8 |
title | Haskell the craft of functional programming |
title_auth | Haskell the craft of functional programming |
title_exact_search | Haskell the craft of functional programming |
title_full | Haskell the craft of functional programming Simon Thompson |
title_fullStr | Haskell the craft of functional programming Simon Thompson |
title_full_unstemmed | Haskell the craft of functional programming Simon Thompson |
title_short | Haskell |
title_sort | haskell the craft of functional programming |
title_sub | the craft of functional programming |
topic | HASKELL (DE-588)4318275-6 gnd Funktionale Programmierung (DE-588)4198740-8 gnd |
topic_facet | HASKELL Funktionale Programmierung |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=021193242&sequence=000002&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT thompsonsimon haskellthecraftoffunctionalprogramming |