Script:
Functors and friends
Headline
Generalzing list maps and folds to other types
Description
List processing with maps and folds is generalized to designated classes of types. In particular, we look at data types that can be thought of as modeling containers, and we treat them in a way similar to lists. This is possible, in particular, for maybe types and rose trees. To this end, we leverage the notions of functor and foldable type. The corresponding type classes rely on higher-kinded polymorphism. We also demonstrate the use of functors and foldable types for more domain-specific types such as companies, departments, and employees. (It turns out that we need to adjust the domain-specific types to the purpose of (salary) transformation and aggregation. Finally, we exercise maps and folds in an advanced example of bidirectional transformation. In passing, we also engage in the more general notion of applicative functors which allow for functorial computations to be sequenced (unlike plain functors),
Concepts
- Type classes
- Data types used for illustration
- Other concepts at play
Languages
Features
Contributions
- Contribution:haskellFunctorial: Functorial total and cut
- Contribution:haskellNonfunctorial: Reusable abstractions for salary access
- Contribution:haskellTree: Bidirectional transformations
User contributions
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.