def show
import bend-kit-netip@0.1.0.0/netip.bend as Netipimport Base
336# RFC 5952: lowercase, shortest hex groups, longest leftmost "::" run.
337def show(addr: Addr) -> String:
338 match addr:
339 case V4{w}:
340 v4.show(w)
341 case V6{+a, +b, +c, +d}:
342 v6.show.mapped(Bool.and(U32.is_zero(a), Bool.and(U32.is_zero(b), U32.is_eq(c, 65535))), a, b, c, d)