• Complain

Vicenç Torra - Scala From a Functional Programming Perspective - an Introduction to the Programming Language

Here you can read online Vicenç Torra - Scala From a Functional Programming Perspective - an Introduction to the Programming Language full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Cham;New York Inc;Torra, Vicen, year: 2017, publisher: Springer International Publishing, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Vicenç Torra Scala From a Functional Programming Perspective - an Introduction to the Programming Language
  • Book:
    Scala From a Functional Programming Perspective - an Introduction to the Programming Language
  • Author:
  • Publisher:
    Springer International Publishing
  • Genre:
  • Year:
    2017
  • City:
    Cham;New York Inc;Torra, Vicen
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Scala From a Functional Programming Perspective - an Introduction to the Programming Language: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Scala From a Functional Programming Perspective - an Introduction to the Programming Language" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Vicenç Torra: author's other books


Who wrote Scala From a Functional Programming Perspective - an Introduction to the Programming Language? Find out the surname, the name of the author of the book and a list of all author's works by series.

Scala From a Functional Programming Perspective - an Introduction to the Programming Language — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Scala From a Functional Programming Perspective - an Introduction to the Programming Language" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Springer International Publishing AG 2016
Vicen Torra Scala: From a Functional Programming Perspective Lecture Notes in Computer Science 9980 10.1007/978-3-319-46481-7_1
1. An Introduction to Functional Programming Languages
Vicen Torra 1
(1)
University of Skvde, Skvde, Sweden
Vicen Torra
Email:
Functional programming is a programming paradigm that has one of its roots in the programming language LISP . LISP, which stands for LISt Processing , was created in 1958 by John McCarthy . Its main characteristic is that computation is in terms of functions and recursion. Syntaxis in LISP is based on the use of a prefix notation and the parenthesis, no much syntactic sugar is used. For example, the function to compute the factorial can be written as follows in LISP:
The theoretical basis of functional programming is -calculus developed by A - photo 1
The theoretical basis of functional programming is Picture 2 -calculus , developed by A. Church in the 30s. The development of Picture 3 -calculus was parallel (or a little earlier [16, 29]) to the development of Turing machines by A. Turing . Both were developed as computational models and were proven equivalent from the point of view of the functions they can compute. They were independently used to prove the Entscheidungsprobleme (decision problem). While Turing machines rely on the concept of state and transition functions between states, Picture 4 -calculus relies on the concept of rewriting.
Functional programming sees programs as functions, and functions are decomposed into other functions. In pure functional programming the only value that the function computes is what it returns, there are not side effects, and the input values are not modified.
For example, a typical implementation of the factorial in an imperative language is as follows.
Observe that variables i and result change their values while the loop is - photo 5
Observe that variables i and result change their values while the loop is executed. Compare that with the variable n in the recursive definition of factorial. Note that the value n does not change.
So, a main difference between functional programming and imperative programming is that in the latter, programming is achieved by means of a modification of the variables in the program. This corresponds to changing the states, as in the Turing machine.
1.1 Main Characteristics of Functional Programming Languages
We have underlined above that functional programming has as its main characteristic in that programs are based on the definition of functions. Functions are the main elements in programs. The main properties of functional programming languages include the following (we include the section were these concepts are studied).
  • Expressions without side effects (Sect. )
  • First-class functions (Sect. ). This includes
    • Pass functions as arguments
    • Return functions
    • Assign them to variables and to data structures
    • Anonymous functions
  • Higher-order functions (Sect. )
  • Recursion (Sect. )
  • Immutable data structures (Sect. )
  • Lazy evaluation (Chap. )
  • Do not require tail-recursive optimization (Sect. )
This compares with the main characteristics of imperative programming languages.
  • Commands are the main components of the language
  • Functions and procedures
  • Iteration and loops
  • Mutable objects
  • Eager evaluation
  • Recursion is not supported
Table compares functional programming and imperative programming . The table also includes the logic programming paradigm .
Table 1.1
Differences between the functional, logic and imperative paradigms.
Functional
Logic
Imperative
A program as a
Function
Relationship
Command
Building blocks
Expressions (evaluation)
Horn clauses (true/false?)
Assignment (execution)
Program Construction
Composing functions
Defining facts and rules
Sequences of commands
Variables
Immutable
Immutable
Mutable
(let x be)
(let x be)
(memory cell)
Repetition
Recursion
Recursion
Loop
1.2 Some Functional Programming Languages
In this section we review briefly four functional languages that have had a strong influence in the development of this type of languages. The list of functional programming languages is, however, very large and includes e.g. Miranda, Hope, and Erlang.
1.2.1 LISP
This is the classical functional programming language. It was created by J. McCarthy 1958 and described in [12]. See [13] for details on its creation. It received influence from the Information Processing Language (a language created between 1955 and 1956), which already implemented concepts as recursion and list-processing. This language is still alive and used today and has influenced indirectly most functional programming languages and directly the language Scheme .
1.2.2 FP
This language was proposed by J. Backus and it is a kind of Extreme Functional Programming language, with no variables. The internal product IP of two vectors is defined as follows.
Def IP Picture 6 /+ o Picture 7 x o trans
Here, Trans is the transpose of the two vectors of the input (seen as a matrix). Then, we apply the product to all pairs of numbers and finally we add them.
Another example is the product of two matrices. Their definition is as follows.
Def MM Picture 8 ( Picture 9Picture 10 IP) o ( Picture 11 distl) o distr o [1, trans o 2]
The language FP is described by Backus (well known for the development of the language FORTRAN and the BNF - Backus-Naur form ) in [2]. Dijkstra presented in 1979 (see [5]) a critic of the paper by Backus [2].
1.2.3 Standard ML (SML)
This is a strongly (statically) typed functional programming language. This language is able to deduce the type of objects and functions. SML permits to define algebraic data types easily. This is discussed in Sect. (examples in SML will be given).
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Scala From a Functional Programming Perspective - an Introduction to the Programming Language»

Look at similar books to Scala From a Functional Programming Perspective - an Introduction to the Programming Language. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Scala From a Functional Programming Perspective - an Introduction to the Programming Language»

Discussion, reviews of the book Scala From a Functional Programming Perspective - an Introduction to the Programming Language and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.