From 845605aa48c4c9423de222d93a20c3a5b34870aa Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Sun, 17 Aug 2025 17:30:51 +0100 Subject: [PATCH] fix compile error in make-text-builder.sml --- fcore/make-text-builder.sml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/fcore/make-text-builder.sml b/fcore/make-text-builder.sml index 074308d..242f531 100644 --- a/fcore/make-text-builder.sml +++ b/fcore/make-text-builder.sml @@ -1,12 +1,16 @@ +structure PosData = +struct + (* I don't like introducing new bindings in the global name space + * so the pos_data type is introduced in a new struct. *) + type t = {chr: char, strIdx: int, absIdx: int, hd: string, tl: string list} +end + signature MAKE_TEXT_BUILDER = sig type state type env - type pos_data = - {chr: char, strIdx: int, absIdx: int, hd: string, tl: string list} - - val folder: pos_data * env * state -> state + val folder: PosData.t * env * state -> state val stopFold: state -> bool end @@ -29,3 +33,14 @@ struct buildLoop (strIdx + 1, absIdx + 1, hd, tl, env, state) end end + +structure Good = + MakeTextBuilder + (struct + type state = unit + type env = unit + + fun folder (_, _, _) = () + fun stopFold () = false + fun finish () = 33 + end)