Explorer

core.module-entries-changed-signatures

description
Part ids whose type-relevant signature changed between the previous module entries and those of the snapshot (declared type, or the declaration of a type part)
type
Fn(
  previous: List<List<Record{
    part_id: String,
    module_id: String,
    part_type: Union{#none, #some(@core.expression)},
    type_declaration: Union{#none, #some(@core.expression)},
    expression_key: Union{#none, #some(String)},
    has_expression: Boolean,
    references: List<String>
  }>>,
  committed: List<Record{
    part_id: String,
    module_id: String,
    part_type: Union{#none, #some(@core.expression)},
    type_declaration: Union{#none, #some(@core.expression)},
    expression_key: Union{#none, #some(String)},
    has_expression: Boolean,
    references: List<String>
  }>,
  index: Number,
  changed: List<String>
) -> List<String>
expression
fn(previous$0, committed$1, index$2, changed$3) =>
  match @core.list-get(list: $1, index: $2) {
    #none(_) =>
      $3,
    #some(entry$4) =>
      let prev$5 = @core.module-entry-lookup(entries: $0, part_id: $4.part_id);
      let sig_changed$6 = match $5 {
          #none(_) =>
            true,
          #some(before$7) =>
            match @core.equal(left: $7.part_type, right: $4.part_type) {
              false =>
                true,
              true =>
                match $4.type_declaration {
                  #none(_) =>
                    false,
                  #some(_) =>
                    @core.not(value: @core.option-string-equals(a: $7.expression_key, b: $4.expression_key))
                }
            }
        };
      match $6 {
        true =>
          @core.module-entries-changed-signatures(
            previous: $0,
            committed: $1,
            index: @core.plus(left: $2, right: 1),
            changed: @core.list-append(list: $3, item: $4.part_id)
          ),
        false =>
          @core.module-entries-changed-signatures(previous: $0, committed: $1, index: @core.plus(left: $2, right: 1), changed: $3)
      }
  }
visibility
public
core.module-entries-changed-signatures (project definy, branch main, snapshot CfIAXM725tR74SWd4aoTUz4-JJQfqnllblZbQ2Sv204)
id: v5ZaLUXy043q-o_m7hfwRLsT1i0Jf2ISaAvHMH9N3nY
content hash: ZsS0A9PkXCD9NHxtluOOFLDdQ6-eEnL7xhcZxAlTvTc