Explorer

definy.read-snapshot-check-input-full

description
definy.read-snapshot-check-input with all the parts of the latest main snapshots as the type environment (used when a part needs the evaluator, so its references are not known before evaluating it)
type
Fn(
  commit: @definy.stored-snapshot,
  parts: List<@definy.stored-snapshot-part>,
  latest: List<@definy.event-snapshot>,
  then: Fn(
    input: Union{#none, #some(@definy.snapshot-check-source)},
    commit: Union{#none, #some(@definy.stored-snapshot)}
  ) -> @definy.service-io
) -> @definy.service-io
expression
fn(commit$0, parts$1, latest$2, then$3) =>
  let hashes$4 = @core.list-concat(
      left: @core.list-map(
        T: @definy.stored-snapshot-part,
        U: String,
        f: fn(item$5) =>
          $5.content_hash,
        xs: $1
      ),
      right: @definy.snapshot-parts-hashes(
        parts_list: @core.list-map(
          T: @definy.event-snapshot,
          U: List<@definy.stored-snapshot-part>,
          f: fn(item$6) =>
            @definy.snapshot-parts(modules: $6.commit.modules, index: 0),
          xs: $2
        ),
        index: 0
      )
    );
  @definy.read-resolutions(
    content_hashes: $4,
    then: fn(resolutions$7) =>
      @definy.read-definitions(
        content_hashes: @definy.unresolved-hashes(hashes: $4, resolutions: $7),
        then: fn(definitions$8) =>
          $3(
            input: #some({
              project_name: $0.project_name,
              parts: @core.list-map(
                T: @definy.stored-snapshot-part,
                U: @definy.snapshot-check-source-part,
                f: fn(item$9) =>
                  @definy.source-part-of(part: $9, definitions: $8),
                xs: $1
              ),
              latest_commits: @core.list-map(
                T: @definy.event-snapshot,
                U: @definy.latest-snapshot-source,
                f: fn(item$10) =>
                  {
                    project_name: $10.commit.project_name,
                    parts: @core.list-map(
                      T: @definy.stored-snapshot-part,
                      U: @definy.snapshot-check-source-part,
                      f: fn(item$11) =>
                        @definy.source-part-of(part: $11, definitions: $8),
                      xs: @definy.snapshot-parts(modules: $10.commit.modules, index: 0)
                    )
                  },
                xs: $2
              ),
              project_module_ids: @definy.project-module-ids(commits: $2, project_name: $0.project_name, index: 0),
              resolutions: $7
            }),
            commit: #some($0)
          )
      )
  )
visibility
public
definy.read-snapshot-check-input-full (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: MNI6fCBts5t68PN3-aDo-7hgd4WLkFAojknLNjg4Muw
content hash: 7D8jKnCauX2M0Ez_-cnafO-iLRyrUxblDz-iVlp4ecw