Explorer

definy.write-resolutions

description
(ja) 即時解決できたパーツを解決キャッシュに書く。中身の無いものは飛ばす
type
Fn(
  parts: List<@definy.snapshot-check-part>,
  index: Number,
  entries: List<@definy.resolution-cache-entry>,
  then: Fn() -> @definy.service-io
) -> @definy.service-io
expression
fn(parts$0, index$1, entries$2, then$3) =>
  match @core.list-get(list: $0, index: $1) {
    #none(_) =>
      match @core.equal(left: @core.list-length(value: $2), right: 0) {
        true =>
          $3(),
        false =>
          #write_cached_resolutions({
            version: @definy.resolution-cache-version,
            entries: $2,
            then: fn(written$7) =>
              $3()
          })
      },
    #some(part$4) =>
      match $4.content {
        #none(_) =>
          @definy.write-resolutions(
            parts: $0,
            index: @core.plus(left: $1, right: 1),
            entries: $2,
            then: fn() =>
              $3()
          ),
        #some(content$5) =>
          @definy.write-resolutions(
            parts: $0,
            index: @core.plus(left: $1, right: 1),
            entries: @core.list-append(
              list: $2,
              item: {
                content_hash: $4.content_hash,
                content: $5,
                entry: @definy.content-type-check-entry(part_id: $4.id, module_id: $4.module_id, content_hash: $4.content_hash, content: $5)
              }
            ),
            then: fn() =>
              $3()
          )
      }
  }
visibility
public
definy.write-resolutions (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: z6u3exrOo_DlVVndSLgmUj3iSdVY_k9Y4PDdlPgkoZ8
content hash: SCgG8UMj7lnzp5zRf2Oy0eeu61au5ExXBqJjRwnGFsQ