Headline

An abstraction for constructing new types

Illustration

For instance, in functional programming with Haskell, these are typical type constructor:

  • The list type constructor for constructing list types from an element type
  • Any tuple type constructor for constructing types of products from two component types
  • The maybe type constructor for adding partiality to a type
  • The either type constructor for combining types as cases
These types could or are defined in Haskell in follows:

data [a] = [] | (a:[a])
data (a, b) = (a, b)
data Maybe a = Nothing | Just a
data Either a b = Left a | Just a

If we were to remove the special notation for lists and tuples, thus using ordinary type and constructor names, then the first two declarations take this form:

data List a = Nil | Cons a (List a)
data Pair a b = Pair a b


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.