News for hackers. Stuff that matters.
Re:Types as Interfaces by mahguy on Thursday July 25, 2024 @05:41AM (#41066681)
The most consistent solution with the least ceremony. Now it is a module, not a type though.
Re:Types as Interfaces by derdi on Friday July 26, 2024 @07:27AM (#41077712)
You can create first-class values of this module type, and since values have types, "it" is a type. Specifically, my_foobar has type (module FOOBAR).

Actually getting values out of such a module-typed structure does involve some ceremony, however:

    let f =
      let module M = (val my_foobar) in
      M.foo