def insert.branch
bend-kit-router@0.2.0.0 · router.bend:209
import bend-kit-router@0.2.0.0/router.bend as Router
import Base
209def insert.branch(~A: Data, same: Bool, segments: List<&2, Segment>, +handlers: List<&2, Handler<A>>, +old_groups: List<&2, U32>, allowed: String, tail: List<&2, Path<A>>, entry: Handler<A>, groups: List<&2, U32>, rest: Unit -> Result<&2, &2, Error, List<&2, Path<A>>>) -> Result<&2, &2, Error, List<&2, Path<A>>>:
210 match same:
211 case True{}:
212 Handler{+method, pattern, ss, action} = entry
213 insert.merge(~A, handler.has(~A, handlers, method), groups.eq(old_groups, groups), Handler{method, pattern, ss, action}, segments, handlers, old_groups, tail)
214 case False{}:
215 do Result<&2, &2, Error, List<&2, Path<A>>>:
216 remaining : List<&2, Path<A>> <- rest(Unit{})
217 return Path{segments, handlers, old_groups, allowed} <> remaining