TraceContext.Entries.add.if: def of bend-trace-context@0.2.0.0 Import: import bend-trace-context@0.2.0.0/trace_context.bend as TraceContext Lines 2156-2163 of bend-trace-context@0.2.0.0/trace_context.bend: https://jend.leeeet.dev/read.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&start_line=2156&end_line=2163 import Base # Keep the entries unchanged when the key was present; otherwise add the # entry at the end. def Entries.add.if(entries: List<&2, StateEntry>, entry: StateEntry, present: Bool) -> List<&2, StateEntry>: match present: case True{}: entries case False{}: List.append(&2, StateEntry, entries, Con{entry, Nil{}}) Uses (4): 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=List.append https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=StateEntry