on master help sign in
Remove local forEach definition; stdlib provides it as a built-in
10c4580iko
server.knot−9
@@ -323,15 +323,6 @@ capList = \items maxN -> drop (max 0 (count items - maxN)) (sortBy (\x -> x.expi
323capPerKey : [{pubkey: PubkeyHex, expiresAt: Timestamp | r}] -> PubkeyHex -> Int -> [{pubkey: PubkeyHex, expiresAt: Timestamp | r}]
323capPerKey : [{pubkey: PubkeyHex, expiresAt: Timestamp | r}] -> PubkeyHex -> Int -> [{pubkey: PubkeyHex, expiresAt: Timestamp | r}]
324capPerKey = \items pubkey maxN -> union (filter (\x -> not (x.pubkey == pubkey)) items) (capList (filter (\x -> x.pubkey == pubkey) items) (maxN - 1))
324capPerKey = \items pubkey maxN -> union (filter (\x -> not (x.pubkey == pubkey)) items) (capList (filter (\x -> x.pubkey == pubkey) items) (maxN - 1))
325
325
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−
335-- Like forEach, but collects each action's result into a list.
326-- Like forEach, but collects each action's result into a list.
336mapEach : [a] -> (a -> IO {} b) -> IO {} [b]
327mapEach : [a] -> (a -> IO {} b) -> IO {} [b]
337mapEach = \items action -> case items of
328mapEach = \items action -> case items of