Programming with Bananas in OCaml

By bananas, I mean banana brackets as in the famous paper “Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire” by Meijer et al.  In this post I only focus on bananas, also called catamorphisms….

Lexical Scoping in OCaml

Like many other modern languages, OCaml uses lexical (or static) scoping.  That is, in OCaml, when your function includes a name that calls a variable, in the function, that variable has the value when the…

Interfacing OCaml with PostgreSQL

In the last post I talked about building an OCaml project using Dune.  In this post I continue with a more complex project.  The project interfaces OCaml and PostgreSQL (a database system) with Caqti (a…