Explorer

core.value-to-list

description
Read each item of a list of core.value with decode, appending to acc from index. none if an item cannot be read (generated by scripts/generate_value_decoders.ts)
type
Fn(
  T: Type,
  items: List<@core.value>,
  decode: Fn(value: @core.value) -> Union{#none, #some(Param("T"))},
  index: Number,
  acc: List<Param("T")>
) -> Union{#none, #some(List<Param("T")>)}
expression
fn(T$0, items$1, decode$2, index$3, acc$4) =>
  match @core.list-get(list: $1, index: $3) {
    #none(_) =>
      #some($4),
    #some(item$5) =>
      match $2(value: $5) {
        #some(decoded$6) =>
          @core.value-to-list(
            T: $0,
            items: $1,
            decode: fn(value$7) =>
              $2(value: $7),
            index: @core.plus(left: $3, right: 1),
            acc: @core.list-append(list: $4, item: $6)
          ),
        _ =>
          #none
      }
  }
visibility
public
core.value-to-list (project definy, branch auto-release, snapshot oiQgPqhJm-TbM4kexXeRHBaJB_tS7gwBSewII64P-44)
id: KVyzjZBZVI7qw51IJq_tZUO8RUhfg06hJ9Lq1mLvAJ8
content hash: 6E5ncpM4QTBTfFZ9LGl2RCq9xr35NlfJ4rvAnaR9Nn0