Explorer

core.count-functions-in-union-variants

description
count plus the functions in the payload types of the union variants from index
type
Fn(
  items: List<Record{tag: String, payload_type: Union{#none, #some(@core.expression)}}>,
  index: Number,
  count: Number
) -> Number
expression
fn(items$0, index$1, count$2) =>
  match @core.list-get(list: $0, index: $1) {
    #none(_) =>
      $2,
    #some(item$3) =>
      @core.count-functions-in-union-variants(
        items: $0,
        index: @core.plus(left: $1, right: 1),
        count: match $3.payload_type {
          #some(payload$4) =>
            @core.count-functions-acc(expr: $4, count: $2),
          _ =>
            $2
        }
      )
  }
visibility
public
core.count-functions-in-union-variants (project definy, branch auto-release, snapshot oiQgPqhJm-TbM4kexXeRHBaJB_tS7gwBSewII64P-44)
id: V6FzLqq2P4hFngqpQpun77MtwEg1UO6C9pFKJfJFugM
content hash: jVEy1R9QZVdc8i2NdGsCF2lBl_JPhf4rIpioqtiL1a0