Skip to content

Instantly share code, notes, and snippets.

@jtpaasch
jtpaasch / Modalities-Notes.md
Last active January 22, 2022 15:40
Notes on modalities in category theory and type theory

Modalities

  • Mitchell, Foundations, section 7.3 (Kripke Lambda Models)
  • Ranta, article on possible worlds
  • Bell, Topos: Local Set Theories
  • Goldblatt, Mathematics of Modality chapters on modality
  • nLab on categories of contexts (syntactic categories)
  • Taylor, Practical Foundations, chapter on CCCs has stuff on categories of contexts
  • Emily Reihl's video lecture on monads and Lawere theories
  • Primiero on information
@jtpaasch
jtpaasch / Setting-up-editors-for-OCaml.md
Last active February 16, 2022 17:23
Notes on setting up emacs/vim for OCaml

Setting up editors for OCaml

Setting up the package manager - emacs

Add this to .emacs:

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
@jtpaasch
jtpaasch / Heyting-algebras.md
Last active March 5, 2022 00:20
Notes on Heyting Algebras

Heyting Algebras

A Heyting algebra is a bicartesian closed poset. I.e.,

  • It has a greatest element 1 (top, true)
  • It has a least element 0 (bottom, false)
  • It has all meets (intersections, products, logical "and")
  • It has all joins (unions, coproducts, sums, logical "or")
  • It has all horseshoes (internalized implications, exponentials, the material conditional)
@jtpaasch
jtpaasch / Makefile
Last active April 6, 2022 18:19
A simple example of using Cmdliner to create a command line tool
TOOL := main.exe
#####################################################
# DEFAULT
#####################################################
.DEFAULT_GOAL := all
all: clean run
@jtpaasch
jtpaasch / Makefile
Created April 6, 2022 18:21
An example of subcommands with OCaml's Cmdliner
TOOL := main.exe
#####################################################
# DEFAULT
#####################################################
.DEFAULT_GOAL := all
all: clean run
@jtpaasch
jtpaasch / CS-Papers.md
Last active August 13, 2022 15:01
A list of papers in programming languages and CS that I want to check out
@jtpaasch
jtpaasch / How-Linkers-Work.md
Created September 27, 2022 23:50
My notes on how linkers work

How Linkers Work

These notes explain how a linker works and how to write a linker script. It is very basic, but the goal is to illuminate how it works in the simplest possible way.

The linker for most Linux systems is ld, which has a default linker script. To see the default linker script:

ld --verbose

To specify a custom linker script:

@jtpaasch
jtpaasch / Relational-program-verification.md
Last active October 27, 2022 20:05
Notes on relational program verification

Relational Verification

Beckert, B. and M. Ulbrich. (2018) "Trends in Relational Program Verification." In I. Schaefer and P. Muller (Eds.), Principled Software Development: Essays Dedicated to Arnd Poetzsch-Heffter on the Occasion of His 60th Birthday. Springer, pp. 41-58.

Relational verification verifies relational properties that relate different programs.

To verify relational properties, one must (in principle) compare several runs of the same program.

Some examples of relational properties:

@jtpaasch
jtpaasch / Fold_left_vs_right.hs
Created October 6, 2023 14:17
The difference between fold left and fold right
-- This version of fold applies 'f' to the head of the list '[a]'
-- to get a new accumulation 'acc', then it recurses into the tail
-- of the list '[a]' where it then repeats. This means that the
-- accumulated results are built up by adding in the elements
-- of the list, one at a time, starting with the first element
-- (on the left), and then moving through them, going right.
foldLeft :: (b -> a -> b) -> b -> [a] -> b
foldLeft f acc xs =
case xs of
[] -> acc