Explorer

core.value-to-match-arm

description
Read a value of the evaluator (core.value) as core.match-arm. none if the shape differs (generated by scripts/generate_value_decoders.ts)
type
Fn(value: @core.value) -> Union{#none, #some(@core.match-arm)}
expression
fn(value$0) =>
  match $0 {
    #record(fields$1) =>
      match @core.value-record-field(fields: $1, key: "pattern", index: 0) {
        #some(field$2) =>
          match @core.value-to-pattern(value: $2) {
            #some(pattern$3) =>
              match @core.value-record-field(fields: $1, key: "body", index: 0) {
                #some(field$4) =>
                  match @core.value-to-expression(value: $4) {
                    #some(body$5) =>
                      #some({pattern: $3, body: $5}),
                    _ =>
                      #none
                  },
                _ =>
                  #none
              },
            _ =>
              #none
          },
        _ =>
          #none
      },
    _ =>
      #none
  }
visibility
public
core.value-to-match-arm (project definy, branch auto-release, snapshot oiQgPqhJm-TbM4kexXeRHBaJB_tS7gwBSewII64P-44)
id: FwVGZHbvw77RFC4hNWauiuOjtQ4u2-xqs2EnQ28EUZE
content hash: EHQHyIno6l-PGSGxeBJysr7iDhzCXQk1S-eLg7RKfbA