# Programming with Applicative-like expressions

**Authors:** Jan Malakhovski, Sergei Soloviev

arXiv: 1905.10728 · 2019-05-28

## TL;DR

This paper explores the algebraic structure of Applicative-like computations, demonstrating how they can be generalized to simplify data transformations and reduce boilerplate in functional programming.

## Contribution

It introduces a generalized algebraic framework for Applicative-like computations, extending their applicability beyond parsing to broader data transformation tasks.

## Key findings

- Applicative computations can be interpreted as constructing pluggable data type 'ports'
- Several instances of the generalized algebraic structure are demonstrated
- Applicative-like techniques can automate and simplify boilerplate code in functional programs

## Abstract

The fact that Applicative type class allows one to express simple parsers in a variable-less combinatorial style is well appreciated among Haskell programmers for its conceptual simplicity, ease of use, and usefulness for semi-automated code generation (metaprogramming).   We notice that such Applicative computations can be interpreted as providing a mechanism to construct a data type with "ports" "pluggable" by subcomputations. We observe that it is this property that makes them so much more convenient in practice than the usual way of building the same computations using conventional composition. We distill this observation into a more general algebraic structure of (and/or technique for expressing) "Applicative-like" computations and demonstrate several other instances of this structure.   Our interest in all of this comes from the fact that the aforementioned instances allow us to express arbitrary transformations between simple data types of a single constructor (similarly to how Applicative parsing allows to transform from streams of Chars to such data types) using a style that closely follows conventional Applicative computations, thus greatly simplifying (if not completely automating away) a lot of boiler-plate code present in many functional programs.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1905.10728/full.md

## References

26 references — full list in the complete paper: https://tomesphere.com/paper/1905.10728/full.md

---
Source: https://tomesphere.com/paper/1905.10728