on master help sign in
Remove local forEach definition; stdlib provides it as a built-in
commit10c4580ce1dfd0139d8c823496cf73f6b14c4026 authoriko <mail@iko.soy> dateSat 9 May 2026, 22:00 (5 months ago) parent58f6e23
1 file changed−9
server.knot−9
server.knot−9
@@ -323,15 +323,6 @@ capList = \items maxN -> drop (max 0 (count items - maxN)) (sortBy (\x -> x.expi
323323capPerKey : [{pubkey: PubkeyHex, expiresAt: Timestamp | r}] -> PubkeyHex -> Int -> [{pubkey: PubkeyHex, expiresAt: Timestamp | r}]
324324capPerKey = \items pubkey maxN -> union (filter (\x -> not (x.pubkey == pubkey)) items) (capList (filter (\x -> x.pubkey == pubkey) items) (maxN - 1))
325325
326−-- Sequence an IO action over each item, in order. Recurses through the list
327−-- one element at a time; this is the closest equivalent of `mapM_` here.
328−forEach : [a] -> (a -> IO eff {}) -> IO eff {}
329−forEach = \items action -> case items of
330− [] -> yield {}
331− Cons x rest -> do
332− action x
333− forEach rest action
334−
335326-- Like forEach, but collects each action's result into a list.
336327mapEach : [a] -> (a -> IO {} b) -> IO {} [b]
337328mapEach = \items action -> case items of