Headline

Abstraction over type expressions

Illustration

The name type synonym is specifically used in Language:Haskell. (The same concept goes by the name "typedef" in, for example, Language:C.) For instance, the following Haskell declaration introduces a type synonym for salaries to be represented as floats.

type Salary = Float

The choice of a type synonym implies that salaries and floats are compatible in a typing sense: any float is immediately acceptable whereever a salary is expected, and vice versa. The type synonym is merely a convenience without any proper effect on typing.

Thus, if you look at the signature of a function, such as total:

total :: Company -> Float

This signature could as well be transformed by resolving all type synonyms (described by Feature:Flat_company) to a less understandable variant:

total :: ([Char], [([Char], [Char], Float)]) -> Float


Marcel Heinz edited this article at Fri, 01 Jun 2018 13:52:15 +0200
Compare revisions Compare revisions

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.