Explorer

core.validate-module

description
Check that the module name is non-empty and every part satisfies its declared type in the type environment of the module's parts and the external parts (parts of other modules)
type
Fn(
  mod_def: @core.module-definition,
  external: List<Record{
    part_definition_event_hash: String,
    part_type: @core.expression,
    type_declaration: Union{#none, #some(@core.expression)}
  }>
) -> Boolean
expression
fn(mod_def$0, external$1) =>
  match @core.less-than(left: 0, right: @core.string-length(value: $0.name)) {
    true =>
      @core.validate-parts-in-env(
        parts: $0.parts,
        env: @core.build-type-env(
          entries: @core.list-concat(left: $1, right: @core.part-definitions-to-type-env-entries(parts: $0.parts, index: 0, accum: []))
        ),
        index: 0
      ),
    false =>
      false
  }
visibility
public
core.validate-module (project definy, branch auto-release, snapshot oiQgPqhJm-TbM4kexXeRHBaJB_tS7gwBSewII64P-44)
id: derpgtqJ4wdpRytnxYnbXl7ukrpwBiaz-LSaWxhFrn4
content hash: FUT0O_XaXL-bF2cDYgG_XwMRc7BUPE0xd0RJYBOXDoc