From d766b362f1101e73f2fa16ae9a1fdcd140b703e7 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 12 Jun 2023 22:06:48 -0400 Subject: [PATCH] feat fut: add `infix`, builds a `INFIX` as a 1st class module --- src/fut.ml | 6 ++++++ src/fut.mli | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/fut.ml b/src/fut.ml index 34973022..e5d7d235 100644 --- a/src/fut.ml +++ b/src/fut.ml @@ -354,3 +354,9 @@ end) = Infix_ (struct let pool = Some X.pool end) + +let[@inline] infix pool : (module INFIX) = + let module M = Infix (struct + let pool = pool + end) in + (module M) diff --git a/src/fut.mli b/src/fut.mli index ceee34e9..b80e0c48 100644 --- a/src/fut.mli +++ b/src/fut.mli @@ -154,3 +154,7 @@ include INFIX module Infix (_ : sig val pool : Pool.t end) : INFIX + +val infix : Pool.t -> (module INFIX) +(** [infix pool] makes a new infix module. + @since 0.2 *)