Explorer

core.type-equals-apply-arguments

description
Whether the arguments of two `apply` types are the same types by name (in any order)
type
Fn(
  left: List<Record{name: String, type: @core.type-ast}>,
  right: List<Record{name: String, type: @core.type-ast}>,
  index: Number
) -> Boolean
expression
fn(left$0, right$1, index$2) =>
  match @core.list-get(list: $0, index: $2) {
    #none(_) =>
      @core.equal(left: @core.list-length(value: $0), right: @core.list-length(value: $1)),
    #some(argument$3) =>
      match @core.function-type-parameter-find(parameters: $1, name: $3.name, index: 0) {
        #none(_) =>
          false,
        #some(right_type$4) =>
          @core.and(
            left: @core.type-equals(t1: $3.type, t2: $4),
            right: @core.type-equals-apply-arguments(left: $0, right: $1, index: @core.plus(left: $2, right: 1))
          )
      }
  }
visibility
public
core.type-equals-apply-arguments (project definy, branch compiled-tests, snapshot i6TqClmqVS9FK8rKOvJ43l6Tevx8pvYJ5-zaQqNwemc)
id: CTWS3O527aComdgkA1qNdrq5X3LvJpp39V_scuCMflE
content hash: -6aoWyf_fz0OftnA7tnkYQ1jjNtm8tCkthJx0ZaN_M4