Applications of Category Theory to Web Programming

Loading...
Thumbnail Image
Journal Title
Journal ISSN
Volume Title
Perustieteiden korkeakoulu | Master's thesis
Date
2018-05-14
Department
Major/Subject
Computer Science
Mcode
SCI3042
Degree programme
Master’s Programme in Computer, Communication and Information Sciences
Language
en
Pages
62
Series
Abstract
Modern Web applications are highly interactive and complex with various challenges, such as maintaining mutable states and making asynchronous operations, which need to be addressed. By addressing these challenges, Web applications can be made easier to develop, maintain and reason about. This thesis presents common category theory concepts and how they can be used to solve these challenges by structuring and easing the development of complex Web applications. The current state and benefits of applying category theory concepts in Web programming are presented by comparing existing category theory based tools in multiple programming languages against the challenges along with concrete examples. Implementations of categorical concepts in the existing tools are compared against the theory. Furthermore, related research about a specific challenge is presented. Many of the challenges can be addressed with various monads as they can model numerous side effects such as DOM manipulations. Researched tools provide different algebraic data types, which implement abstractions such as functor, applicative functor and monad from category theory. These abstractions, in turn, unify several programming languages and libraries. Additionally, they provide clear semantics and laws to build interactive and complex Web applications, which are easy to develop and reason about.

Modernit Web-sovellukset ovat interaktiivisia ja monimutkaisia. Ratkaisemalla Web-ohjelmoinnin haasteita, kuten muuttuvan tilan ylläpito ja asynkronisten operaatioiden hallinta, Web-ohjelmia voidaan kehittää, ylläpitää ja ymmärtää helpommin. Tämä diplomityö esittelee yleisiä kategoriateorian konsepteja sekä niiden hyödyntämistä näiden haasteiden ratkaisemisessa jäsentämällä ja helpottamalla monimutkaisten Web-sovelluksien kehitystä. Kategoriateorian hyödyt ja nykytila ohjelmoinnissa esitellään konkreettisilla esimerkeillä sekä tutkimalla kuinka eri ohjelmointikielissä olemassa olevilla työkaluilla voidaan ratkaista esitettyjä haasteita. Työkalujen kategoriateoriaan pohjautuvien konseptien toteutuksia verrataan teoriaan. Lisäksi esitellään haasteisiin liittyviä aiempia tutkimustuloksia. Useat esitellyistä haasteista voidaan ratkaista hyödyntämällä erilaisia monadeja, joilla voidaan mallintaa lukuisia sivuvaikutuksia kuten DOM-manipulaatioita. Tutkitut työkalut tarjoavat erilaisia algebrallisia rakenteita, jotka toteuttavat kategoriateorian abstraktioita kuten funktori, applikatiivifunktori ja monadi. Nämä abstraktiot vuorostaan yhdistävät useita ohjelmointikieliä ja kirjastoja sekä tarjoavat selkeät rakenteet ja lait helpottamaan monimutkaisten Web-sovellusten kehittämistä ja ymmärtämistä.
Description
Supervisor
Vuorimaa, Petri
Thesis advisor
Vuorimaa, Petri
Keywords
category theory, web programming, challenges, monad, functor, side effects
Other note
Citation