Dune+odoc+papers

Only a short update today, given that the last update was on Tuesday, and in addition it's end of the Michaelmas term here in Cambridge so I've also been busy doing my end-of-term tutorial interviews.

The Dune/odoc work is almost at ready to make a PR. It's far from a complete odoc 3 integration, but it has all of the features that are already in dune's odoc rules, plus some helpful extras. As always, it's the last 20% that takes 80% of the time; things like how it behaves when you don't have all dependencies for all of your code installed, how it interacts with the -p flag and so on. I'm hoping to make a PR next week alongside a blog post describing the experience of getting Claude to do all of the coding.

I've also been working on writing up a description of the odoc expansion algorithm works for a paper. Mostly this week was looking at the module type of feature of OCaml and how this interacts with module substitution. The illustrative case is:

module type S = sig
  module M : sig
    type t
  end

  module N : module type of M
end

module M' : sig
  type t
  type u
end

module type S' = S with module M := M'

Now OCaml describes module type S' as:

module type S' = sig
  module N : sig
    type t
  end
end

whereas odoc describes it as:

module type S' = sig
  module N : module type of M'
end

and what it should actually describe it as is:

module type S' = sig
  module N : sig module type of (M' :> S.M)
end

or something similar, where the :> operator is 'transparent ascription' - essentially limiting the contents of the module to be just those of S.M, but keeping any concrete representations of types that are in M'. This features is obviously not one that's currently implemented in OCaml itself, but it has at least been talked about for a while, and there are a number of papers discussing it, including this one from last year by Blaudeau Clement et al, Fulfilling OCaml Modules with Transparency, with a description of how transparent ascription can be added into the F-ing modules work of Rossberg et al.