From 21bc518c45f73ddea9f3b7953b04f29f69bdc455 Mon Sep 17 00:00:00 2001 From: Magnus Madsen Date: Tue, 24 Feb 2026 10:35:57 +0100 Subject: [PATCH] fix: correct type variable in regions example code (#256) Use type variable `r` instead of value `rc` in the return type and effect annotation of the `toMutDeque` example. Also update to modern Flix foreach syntax. Co-Authored-By: Claude Opus 4.6 --- src/regions.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/regions.md b/src/regions.md index e3e92efc..3df0bdfa 100644 --- a/src/regions.md +++ b/src/regions.md @@ -71,9 +71,11 @@ that allocates and returns a mutable data structure. For example, here is the `List.toMutDeque` function: ```flix -def toMutDeque(rc: Region[r], l: List[a]): MutDeque[a, rc] \ rc = +def toMutDeque(rc: Region[r], l: List[a]): MutDeque[a, r] \ r = let d = MutDeque.empty(rc); - forEach(x -> MutDeque.pushBack(x, d), l); + foreach (x <- l) { + MutDeque.pushBack(x, d) + }; d ```