RSSAmplifier

The Zen of Coding · Jun 18, 2025

Making OCaml recursive modules convenient

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

Jane St posted about recursive OCaml modules from recursive signatures a while ago. module rec Even : sig type t = Zero | Succ of Odd . t end = Even and Odd : sig type t = Succ of Even . t end = Odd You cannot have functions inside recursive modules defined this way which is really inconvenient. You can bring the convenience back with just a couple of wrappers, though! module rec Even' : sig type…

Read on joel.id

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.