pathComponents: [String]) -> Value? { switch self { case let .match(string, route): ... case let .capture(parse, convert): ... case let .choice(routes): ... case let .term(value): return value case .zero: return nil } } } // ͞Βʹɺલճͱಉ༷ɺFunctor, Applicative, Alternative ࣮͢Δ...
{ case let .match(string, route): return .match(string, optimize(route)) case let .capture(parse, convert): return .capture(parse, { optimize(convert($0)) }) case let .choice(routes): return _optimizeChoice(routes) case .term, .zero: return route } }