tailieunhanh - Functional Programming

In the 40s the first computers were built. The very first models were ‘programmed’ by means of huge connection boards. Soon the program was stored in computer memory, introducing the first programming languages. Because in those days computer use was very expensive, it was obvious to have the programming language resemble the architecture of the computer as close as possible. A computer consists of a central processing unit and a memory. Therefore a program consisted of instructions to modify the memory, executed by the processing unit. With that the imperative programming style arose. Imperative programming language, like Pascal and C,. | Functional Programming ii Copyright 1992-1995 Jeroen Fokker and Department of Computer Science Utrecht University This text may be reproduced for educational purposes under the following restrictions the text will not be edited or truncated especially this message will be reproduced too the duplicates will not be sold for profits You can reach the author at Jeroen Fokker Vakgroep Informatica Postbus 80089 3508 TB Utrecht e-mail jeroen@. Dutch edition 1st print September 1992 2nd print February 1993 3rd reviewed print September 1993 4th reviewed print September 1994 5th reviewed print September 1995 Spanish edition translated by Hielko Ophoff based on 4th reviewed print September 1994 English edition translated by Dennis Gruijs and Arjan van IJzendoorn based on 5th reviewed print September 1995 iii Contents 1 Functional Programming 1 Functional Languages 1 Functions 1 Languages 1 The Gofer-interpreter 2 Evaluating expressions 2 Defining functions 4 Internal commands 5 Standard functions 5 Primitive predefined 5 Names of functions and operators 6 Functions on numbers 7 Boolean functions 8 Functions on lists 8 Functions on functions 9 Function definitions 9 Definition by combination 9 Definition by case distinction 10 Definition by pattern matching 11 Definition by recursion or induction 12 Layout and comments 13 Typing 14 Kinds of errors 14 Prototyping of expressions 15 Polymorphism 16 Functions with more parameters 17 Overloading 17 Exercises 18 2 Numbers and functions 21 Operators 21 Operators as functions and vice versa 21 Priorities 21 Association 22 Definition of operators 23 Currying 23 Partial parametrization 23 Parentheses 24 Operator sections 24 Functions as a parameter 25 Functions on lists 25 Iteration 26 Composition 27 The .

TỪ KHÓA LIÊN QUAN