Evaluating Linear Functions to Symmetric Monoidal Categories

03/10/2021
by   Jean-Philippe Bernardy, et al.
0

A number of domain specific languages, such as circuits or data-science workflows, are best expressed as diagrams of boxes connected by wires. Unfortunately, functional languages have traditionally been ill-equipped to embed this sort of languages. The Arrow abstraction is an approximation, but we argue that it does not capture the right properties. A faithful abstraction is Symmetric Monoidal Categories (SMCs), but,so far,it hasn't been convenient to use. We show how the advent of linear typing in Haskell lets us bridge this gap. We provide a library which lets us program in SMCs with linear functions instead of SMC combinators. This considerably lowers the syntactic overhead of the EDSL to be on par with that of monadic DSLs. A remarkable feature of our library is that, contrary to previously known methods for categories, it does not use any metaprogramming.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/04/2023

String diagrams for symmetric powers I: In symmetric monoidal ℚ_≥ 0-linear categories

Symmetric powers are an important notion in mathematics, computer scienc...
research
12/31/2018

Generic Programming in OCaml

We present a library for generic programming in OCaml, adapting some tec...
research
03/14/2021

Diagrammatic Differentiation for Quantum Machine Learning

We introduce diagrammatic differentiation for tensor calculus by general...
research
01/26/2021

Symmetric Monoidal Categories with Attributes

When designing plans in engineering, it is often necessary to consider a...
research
03/13/2020

Comb Diagrams for Discrete-Time Feedback

The data for many useful bidirectional constructions in applied category...
research
05/13/2022

Completeness and expressiveness for gs-monoidal categories

Formalised in the study of symmetric monoidal categories, string diagram...
research
04/29/2019

Computational Petri Nets: Adjunctions Considered Harmful

We review some of the endeavors in trying to connect Petri nets with fre...

Please sign up or login with your details

Forgot password? Click here to reset