Explorer

definy.snapshot-check-requests

description
What to check with the type checker: the definitions to check as a core.part-content (definition_check), then the parts to check (to_check of core.type-checker)
type
Fn(ids: List<String>, parts: List<@definy.snapshot-check-part>) -> List<@definy.type-check-request>
expression
fn(ids$0, parts$1) =>
  @core.list-concat(
    left: @core.list-fold(
      T: @definy.snapshot-check-part,
      A: List<@definy.type-check-request>,
      reducer: fn(acc$2, item$3) =>
        match $3.definition_check {
          #none(_) =>
            $2,
          #some(definition$4) =>
            @core.list-append(
              list: $2,
              item: {
                name: @core.string-concat(left: $3.name, right: " (definition)"),
                expression: #some($4),
                part_type: #some(#part_reference<@core.expression>({part_definition_event_hash: "Hxya18xzjpRosGDkGMgY9u5NLI2XUnPniDa3qAsXRRU"})),
                builtin: false
              }
            )
        },
      init: [],
      xs: $1
    ),
    right: @core.list-fold(
      T: String,
      A: List<@definy.type-check-request>,
      reducer: fn(acc$5, item$6) =>
        match @definy.snapshot-check-part-find(parts: $1, id: $6, index: 0) {
          #none(_) =>
            $5,
          #some(part$7) =>
            match $7.content {
              #none(_) =>
                $5,
              #some(content$8) =>
                @core.list-append(
                  list: $5,
                  item: {
                    name: $7.name,
                    expression: $8.expression,
                    part_type: $8.part_type,
                    builtin: @definy.snapshot-check-part-builtin(part: $7)
                  }
                )
            }
        },
      init: [],
      xs: $0
    )
  )
visibility
public
definy.snapshot-check-requests (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: UyfOGfQ27V1b8ilSvh8TP3mPVPElOTtsV8azDv5U2GM
content hash: D1li-JI2XlLkQMbVD9Qs-PxjFHOz8YWbYHqXb8cSanI