Redis.conns.cut: def of bend-kit-redis@0.3.0.0 Import: import bend-kit-redis@0.3.0.0/redis.bend as Redis Lines 1018-1032 of bend-kit-redis@0.3.0.0/redis.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-redis@0.3.0.0/redis.bend&start_line=1018&end_line=1032 import Base # The first n connections; the rest are closed. def conns.cut(xs: List<&1, Conn>, n: Nat) -> IO(List<&1, Conn>): match xs: case Nil{}: IO.pure(List<&1, Conn>, Nil{}) case Con{c, t}: match n: case 0n: do IO>: close(c) conns.cut(t, 0n) case 1n+k: do IO>: r : List<&1, Conn> <- conns.cut(t, k) return c <> r Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=Conn https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=close