Headline

The central abstraction in functional programming

Description

In programming, a function is an abstraction for computation. In functional programming, a function is typically close to what we call a function in mathematics. That is, a function maps values of its domain to values of its range. Outside (pure) functional programming, a function may also involve additional computational aspects or side effects. Functions are defined (or declared) in a program and then elsewhere applied.

Illustration

Consider the following function definition in Language:Haskell.

-- The increment function
inc :: Int -> Int
inc x = x + 1

The definition consists of a type signature assigning a type to the function inc and one equation providing the actual definition. The type signature declares inc as function from Int to Int. The equation binds the variable x on the left-hand side and returns the expression x+1 on the right-hand side.

Consider the following function application: inc is applied to 41; the result is 42.

> inc 41
42

Metadata


There are no revisions for this page.

User contributions

    This user never has never made submissions.

    User edits

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.