def map.cons
import cswap-bend-cli@0.1.0.0/fmt/yscal.bend as Yscalimport Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/fmt/ylex.bend as L
312# Merge one piece's field in front of the chain.
313def map.cons(x: L.JR(), rest: L.JR()) -> L.JR():
314 match x rest:
315 case Done{Json.JField{k, v, n}} Done{b}:
316 Done{Json.JField{k, v, b}}
317 case Fail{e} _:
318 Fail{e}
319 case _ Fail{e}:
320 Fail{e}
321 case _ _:
322 Fail{"bad flow mapping"}