Redis.enc: def of bend-kit-redis@0.3.0.0 Import: import bend-kit-redis@0.3.0.0/redis.bend as Redis Lines 174-207 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=174&end_line=207 import Base import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes def enc(xs: List<&1, Val>, st: E) -> E: match xs: case Nil{}: st case Con{Simple{t}, rest}: enc(rest, line(st, "+", clean(t))) case Con{Error{t}, rest}: enc(rest, line(st, "-", clean(t))) case Con{Int{+hi, +lo}, rest}: enc(rest, put(st, ":" ++ i64.show(hi, lo), Bytes.new(0), True{})) case Con{Bulk{d}, rest}: enc(rest, blob(st, "$", d)) case Con{Arr{items}, rest}: enc(rest, agg(st, 0, enc(items, fresh()))) case Con{Null{}, rest}: enc(rest, put(st, "_", Bytes.new(0), True{})) case Con{Boolean{v}, rest}: enc(rest, put(st, "#" ++ boolean(v), Bytes.new(0), True{})) case Con{Double{t}, rest}: enc(rest, line(st, ",", clean(t))) case Con{BigNum{t}, rest}: enc(rest, line(st, "(", clean(t))) case Con{BulkError{t}, rest}: enc(rest, blob(st, "!", t)) case Con{Verbatim{f, t}, rest}: enc(rest, verbatim(st, f, t)) case Con{Dict{items}, rest}: enc(rest, agg(st, 1, enc(items, fresh()))) case Con{Set{items}, rest}: enc(rest, agg(st, 2, enc(items, fresh()))) case Con{Attr{items}, rest}: enc(rest, agg(st, 3, enc(items, fresh()))) case Con{Push{items}, rest}: enc(rest, agg(st, 4, enc(items, fresh()))) Uses (15): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=new https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=E https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=Val https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=agg https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=blob https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=boolean https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=clean https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=fresh https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=i64.show https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=line https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=put https://jend.leeeet.dev/definition.txt?path=bend-kit-redis@0.3.0.0/redis.bend&name=verbatim