Text this: A categorical semantics for causal structure