Explorer

core

Core built-in module for definy · Public

Snapshot history

Status: Done · Every branch of the project (change the status there)

core.compile-function-bodies-range: Fn(
    functions: List<@core.expression>,
    lo: Number,
    hi: Number,
    ctx: Record{
      parts: List<Record{id: String, expression: @core.expression, base: Number}>,
      inlining: List<String>,
      part_index: List<List<Record{id: String, expression: @core.expression, base: Number}>>,
      strings: List<Record{value: String, address: Number}>
    }
  ) -> List<Number>  // (en) compile-function-bodies over the index range [lo, hi). Splits the range in half so that the recursion depth is O(log n). (ja) compile-function-bodies の index が lo 以上 hi 未満の範囲の分. 範囲を半分に割って再帰するので再帰の深さは O(log n).
core.compile-assign-part-bases: Fn(parts: List<Record{id: String, expression: @core.expression}>, index: Number, base: Number) -> List<Record{id: String, expression: @core.expression, base: Number}>  // The parts with the index of their first function (base): base, then each part's base plus the number of functions in it. Counts the functions of each part once (with the halves of core.compile-assign-part-bases-range, the parts of the left half were counted again at every level). index is not used (the callers pass 0)
core.compile-collect-part-functions: Fn(parts: List<Record{id: String, expression: @core.expression}>, index: Number) -> List<@core.expression>  // Function expressions in the parts from index on, in pre-order
core.compile-collect-part-functions-range: Fn(parts: List<Record{id: String, expression: @core.expression}>, lo: Number, hi: Number) -> List<@core.expression>  // compile-collect-part-functions over the index range [lo, hi). Splits the range in half so that the recursion depth is O(log n).
core.repeat-number: Fn(value: Number, count: Number) -> List<Number>  // A list of count copies of the value
core.compile-record-items: Fn(
    items: List<Record{key: String, value: @core.expression}>,
    index: Number,
    env: List<Record{variable_id: Number, local: Number}>,
    depth: Number,
    fn_base: Number,
    ctx: Record{
      parts: List<Record{id: String, expression: @core.expression, base: Number}>,
      inlining: List<String>,
      part_index: List<List<Record{id: String, expression: @core.expression, base: Number}>>,
      strings: List<Record{value: String, address: Number}>
    }
  ) -> List<Number>  // (en) Instructions that store the key and value pointers of the record fields from index on into the record box held by the local at depth (ja) depth のローカル変数が指すレコードの箱に, index 以降のフィールドのキーと値のポインタを書く命令列
core.compile-record-items-range: Fn(
    items: List<Record{key: String, value: @core.expression}>,
    lo: Number,
    hi: Number,
    env: List<Record{variable_id: Number, local: Number}>,
    depth: Number,
    fn_base: Number,
    ctx: Record{
      parts: List<Record{id: String, expression: @core.expression, base: Number}>,
      inlining: List<String>,
      part_index: List<List<Record{id: String, expression: @core.expression, base: Number}>>,
      strings: List<Record{value: String, address: Number}>
    }
  ) -> List<Number>  // (en) Instructions that push the keys and values of the fields lo..hi of a record literal alternately for array.new_fixed (ja) レコードのリテラルの lo..hi 番目のフィールドのキーと値を交互に積む命令列 (array.new_fixed で配列にする)
core.compile-list-items: Fn(
    items: List<@core.expression>,
    index: Number,
    env: List<Record{variable_id: Number, local: Number}>,
    depth: Number,
    fn_base: Number,
    ctx: Record{
      parts: List<Record{id: String, expression: @core.expression, base: Number}>,
      inlining: List<String>,
      part_index: List<List<Record{id: String, expression: @core.expression, base: Number}>>,
      strings: List<Record{value: String, address: Number}>
    }
  ) -> List<Number>  // (en) Instructions that store the pointers of the list items from index on into the list box held by the local at depth (ja) depth のローカル変数が指すリストの箱に, index 以降の要素のポインタを書く命令列
core.compile-list-items-range: Fn(
    items: List<@core.expression>,
    lo: Number,
    hi: Number,
    env: List<Record{variable_id: Number, local: Number}>,
    depth: Number,
    fn_base: Number,
    ctx: Record{
      parts: List<Record{id: String, expression: @core.expression, base: Number}>,
      inlining: List<String>,
      part_index: List<List<Record{id: String, expression: @core.expression, base: Number}>>,
      strings: List<Record{value: String, address: Number}>
    }
  ) -> List<Number>  // (en) Instructions that push the items lo..hi of a list literal for array.new_fixed (ja) リストのリテラルの lo..hi 番目の要素を積む命令列 (array.new_fixed で配列にする)
core.compile-match-arms: Fn(
    arms: List<@core.match-arm>,
    index: Number,
    env: List<Record{variable_id: Number, local: Number}>,
    depth: Number,
    fn_base: Number,
    ctx: Record{
      parts: List<Record{id: String, expression: @core.expression, base: Number}>,
      inlining: List<String>,
      part_index: List<List<Record{id: String, expression: @core.expression, base: Number}>>,
      strings: List<Record{value: String, address: Number}>
    }
  ) -> List<Number>  // (en) Instructions that try the match arms from index on against the value held by the local at depth (unreachable when none matches) (ja) depth のローカル変数が指す値に対して index 以降のアームを順に試す命令列 (どれにも一致しなければ unreachable)
core.compile-match-arms-tail: Fn(
    arms: List<@core.match-arm>,
    index: Number,
    env: List<Record{variable_id: Number, local: Number}>,
    depth: Number,
    fn_base: Number,
    ctx: Record{
      parts: List<Record{id: String, expression: @core.expression, base: Number}>,
      inlining: List<String>,
      part_index: List<List<Record{id: String, expression: @core.expression, base: Number}>>,
      strings: List<Record{value: String, address: Number}>
    }
  ) -> List<Number>  // (en) core.compile-match-arms whose arm bodies are in tail position (core.compile-tail-instructions) (ja) アームの本体を末尾位置 (core.compile-tail-instructions) としてコンパイルする core.compile-match-arms
core.pattern-locals: Fn(pattern: @core.pattern) -> Number  // Number of local variables core.compile-pattern uses for the payloads of variant patterns
core.compile-pattern: Fn(
    pattern: @core.pattern,
    local: Number,
    next: Number,
    env: List<Record{variable_id: Number, local: Number}>,
    ctx: Record{
      parts: List<Record{id: String, expression: @core.expression, base: Number}>,
      inlining: List<String>,
      part_index: List<List<Record{id: String, expression: @core.expression, base: Number}>>,
      strings: List<Record{value: String, address: Number}>
    }
  ) -> Record{code: List<Number>, env: List<Record{variable_id: Number, local: Number}>, next: Number}  // (en) Instructions that push 1 if the value in local matches the pattern (0 otherwise), the env with the bound variables and the next free local variable (ja) ローカル変数 local の値がパターンに一致すれば 1, しなければ 0 を積む命令列と, 束縛した変数を足した env と, 次に使えるローカル変数
core.expression-to-source: Fn(expr: @core.expression) -> String  // Converts a Definy AST expression to a source code string (self-hosted formatter)
core.call-arguments-to-source: Fn(arguments: List<Record{name: String, value: @core.expression}>, index: Number) -> String  // Arguments of a call from the index as source text
core.type-declaration-to-type-ast: Fn(expr: @core.expression) -> Union{#none, #some(@core.type-ast)}  // Convert the declaration expression of a type part to core.type-ast (core.type-expression-to-type-ast with no type parameters in scope)
core.type-expression-to-type-ast: Fn(expr: @core.expression, parameters: List<Record{parameter_id: Number, parameter_name: String}>) -> Union{#none, #some(@core.type-ast)}  // Convert a type expression to core.type-ast. A variable that is a type parameter (in `parameters`) becomes `parameter(name)`, a call of a part that returns a type becomes `apply`, and a function (a part that takes types and returns a type) becomes its body with the parameters in scope
core.type-parameter-name: Fn(parameters: List<Record{parameter_id: Number, parameter_name: String}>, id: Number, index: Number) -> Union{#none, #some(String)}  // The name of the type parameter whose variable ID is `id`
core.type-expression-arguments-to-type-ast: Fn(
    items: List<Record{name: String, value: @core.expression}>,
    parameters: List<Record{parameter_id: Number, parameter_name: String}>,
    index: Number,
    accum: List<Record{name: String, type: @core.type-ast}>
  ) -> Union{#none, #some(List<Record{name: String, type: @core.type-ast}>)}  // (en) Convert the arguments of a call in a type expression to the arguments of `apply` (ja) 型の式の中の呼び出しの引数を apply の引数にする
core.type-declaration-parameters-to-type-ast: Fn(
    items: List<Record{name: String, type: @core.expression}>,
    index: Number,
    accum: List<Record{name: String, type: @core.type-ast}>,
    parameters: List<Record{parameter_id: Number, parameter_name: String}>
  ) -> Union{#none, #some(List<Record{name: String, type: @core.type-ast}>)}  // (en) Convert the parameters of a function type declaration to type-ast (none if any cannot be converted) (ja) 関数型の宣言の引数を type-ast にする (1 つでも変換できなければ none)
core.type-declaration-fields-to-type-ast: Fn(
    items: List<Record{key: String, value: @core.expression}>,
    index: Number,
    accum: List<Record{key: String, field_type: @core.type-ast}>,
    parameters: List<Record{parameter_id: Number, parameter_name: String}>
  ) -> Union{#none, #some(List<Record{key: String, field_type: @core.type-ast}>)}  // (en) Convert the fields of a record type declaration to type-ast (none if any cannot be converted) (ja) レコード型の宣言のフィールドを type-ast にする (1 つでも変換できなければ none)
core.type-declaration-variants-to-type-ast: Fn(
    items: List<Record{tag: String, payload_type: Union{#none, #some(@core.expression)}}>,
    index: Number,
    accum: List<Record{tag: String, payload_type: Union{#none, #some(@core.type-ast)}}>,
    parameters: List<Record{parameter_id: Number, parameter_name: String}>
  ) -> Union{#none, #some(List<Record{tag: String, payload_type: Union{#none, #some(@core.type-ast)}}>)}  // (en) Convert the variants of a union type declaration to type-ast (none if any cannot be converted) (ja) 直和型の宣言のバリアントを type-ast にする (1 つでも変換できなければ none)
core.build-type-env-parts: Fn(
    entries: List<Record{
      part_definition_event_hash: String,
      part_type: @core.expression,
      type_declaration: Union{#none, #some(@core.expression)}
    }>,
    index: Number,
    accum: @core.part-type-env
  ) -> @core.part-type-env  // (en) Add each part's declared type to the part type environment, and for a type part also the type it declares under the key `{hash}#definition` (ja) 各パーツの宣言型をパーツの型環境に入れる. 型パーツは宣言している型もキー `{hash}#definition` で入れる (core.type-resolve が使う)
core.build-type-env: Fn(
    entries: List<Record{
      part_definition_event_hash: String,
      part_type: @core.expression,
      type_declaration: Union{#none, #some(@core.expression)}
    }>
  ) -> @core.type-env  // (en) Build the type environment for checking parts from the declared types of the latest parts of all modules (type parts also pass their declaration expression) (ja) 全モジュールの最新のパーツの宣言型から, パーツを型検査する型環境を作る (型パーツは宣言式も渡す)
core.part-definitions-to-type-env-entries: Fn(
    parts: List<@core.part-definition>,
    index: Number,
    accum: List<Record{
      part_definition_event_hash: String,
      part_type: @core.expression,
      type_declaration: Union{#none, #some(@core.expression)}
    }>
  ) -> List<Record{
    part_definition_event_hash: String,
    part_type: @core.expression,
    type_declaration: Union{#none, #some(@core.expression)}
  }>  // (en) Turn part definitions into entries for core.build-type-env (a type part also passes its expression as the type declaration) (ja) パーツ定義を core.build-type-env に渡すパーツの一覧にする (型パーツは式を型の宣言として渡す)
core.module-entries-in-module: Fn(
    entries: List<Record{
      part_id: String,
      module_id: String,
      part_type: Union{#none, #some(@core.expression)},
      type_declaration: Union{#none, #some(@core.expression)},
      expression_key: Union{#none, #some(String)},
      has_expression: Boolean,
      references: List<String>
    }>,
    module_id: String,
    same: Boolean,
    index: Number,
    accum: List<Record{
      part_id: String,
      module_id: String,
      part_type: Union{#none, #some(@core.expression)},
      type_declaration: Union{#none, #some(@core.expression)},
      expression_key: Union{#none, #some(String)},
      has_expression: Boolean,
      references: List<String>
    }>
  ) -> List<Record{
    part_id: String,
    module_id: String,
    part_type: Union{#none, #some(@core.expression)},
    type_declaration: Union{#none, #some(@core.expression)},
    expression_key: Union{#none, #some(String)},
    has_expression: Boolean,
    references: List<String>
  }>  // (en) Keep the entries in the module (same is true) or in the other modules (same is false) (ja) モジュールのパーツ (same が true) か, 他のモジュールのパーツ (same が false) だけを残す
core.module-entries-to-type-env-entries: Fn(
    entries: List<Record{
      part_id: String,
      module_id: String,
      part_type: Union{#none, #some(@core.expression)},
      type_declaration: Union{#none, #some(@core.expression)},
      expression_key: Union{#none, #some(String)},
      has_expression: Boolean,
      references: List<String>
    }>,
    index: Number,
    accum: List<Record{
      part_definition_event_hash: String,
      part_type: @core.expression,
      type_declaration: Union{#none, #some(@core.expression)}
    }>
  ) -> List<Record{
    part_definition_event_hash: String,
    part_type: @core.expression,
    type_declaration: Union{#none, #some(@core.expression)}
  }>  // (en) Turn the entries with a declared type into entries for core.build-type-env (entries without a type are left out) (ja) 宣言型のあるパーツを core.build-type-env に渡す形にする (型の無いパーツは入れない)
core.module-entry-lookup: Fn(
    entries: List<List<Record{
      part_id: String,
      module_id: String,
      part_type: Union{#none, #some(@core.expression)},
      type_declaration: Union{#none, #some(@core.expression)},
      expression_key: Union{#none, #some(String)},
      has_expression: Boolean,
      references: List<String>
    }>>,
    part_id: String
  ) -> Union{
    #none,
    #some(Record{
      part_id: String,
      module_id: String,
      part_type: Union{#none, #some(@core.expression)},
      type_declaration: Union{#none, #some(@core.expression)},
      expression_key: Union{#none, #some(String)},
      has_expression: Boolean,
      references: List<String>
    })
  }  // (en) The entry of the part id, in the hash index of the module entries by part id (made with core.list-hash-index in core.type-checker). The part ids are unique in a project
core.option-string-equals: Fn(a: Union{#none, #some(String)}, b: Union{#none, #some(String)}) -> Boolean  // Whether both are some and equal (none is never equal, since it means the value cannot be compared)
core.type-checker-in-env: Fn(env: @core.type-env) -> Fn(expr: @core.expression, expected_type: @core.expression) -> @core.type-result  // Return a function that checks an expression against an expected type in env
core.type-checker: Fn(
    latest: List<Record{
      part_id: String,
      module_id: String,
      part_type: Union{#none, #some(@core.expression)},
      type_declaration: Union{#none, #some(@core.expression)},
      expression_key: Union{#none, #some(String)},
      has_expression: Boolean,
      references: List<String>
    }>,
    committed: List<Record{
      part_id: String,
      module_id: String,
      part_type: Union{#none, #some(@core.expression)},
      type_declaration: Union{#none, #some(@core.expression)},
      expression_key: Union{#none, #some(String)},
      has_expression: Boolean,
      references: List<String>
    }>,
    module_id: String
  ) -> Record{
    to_check: List<String>,
    without_expression: List<String>,
    check: Fn(expr: @core.expression, expected_type: @core.expression) -> @core.type-result
  }  // (en) Plan the check of a module snapshot: overlay the parts in the snapshot on the latest parts of all modules to build the type environment, and decide which parts in the snapshot to check (all of them if a declared type changed). Returns the parts to check, the parts without an expression or a type, and the checker for that environment. With no parts in the snapshot it is the checker for the latest parts (ja) モジュールのスナップショットの検査を決める. 全モジュールの最新のパーツにスナップショットを作るパーツを重ねて型環境を作り, スナップショットを作るパーツのうち検査するもの (宣言型が 1 つでも変われば全部) を決める. 検査するパーツ, 式か型の無いパーツ, その型環境で検査する関数を返す. スナップショットを作るパーツが無ければ最新のパーツの型環境で検査する関数になる
core.validate-part-in-env: Fn(part: @core.part-definition, env: @core.type-env) -> Boolean  // Validates that a part matches its declared type within a given type environment
core.validate-part: Fn(part: @core.part-definition) -> Boolean  // Validates that a part definition expression matches its declared type using the self-hosted type checker
core.validate-parts-in-env: Fn(parts: List<@core.part-definition>, env: @core.type-env, index: Number) -> Boolean  // Validates every part definition in a list under a given type environment
core.validate-parts: Fn(parts: List<@core.part-definition>, index: Number) -> Boolean  // Validates every part definition in a list
core.validate-module: 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  // (en) 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) (ja) モジュール名が空でなく, 構成パーツが, モジュールのパーツと外部のパーツ (他のモジュールのパーツ) から作った型環境のもとで宣言型を満たすかを検証する関数
core.optimize-expression: Fn(expr: @core.expression) -> @core.expression  // Optimizes an AST expression via constant folding and dead branch elimination
core.optimize-binary-call: Fn(
    name: String,
    function: @core.callee,
    arguments: List<Record{name: String, value: @core.expression}>
  ) -> @core.expression  // (en) Fold a call to plus / minus / multiply when both arguments are numbers (ja) plus / minus / multiply の呼び出しの引数が両方数値なら畳み込む
core.list-map: Fn(T: Type, U: Type, f: Fn(item: Param("T")) -> Param("U"), xs: List<Param("T")>) -> List<Param("U")>  // Apply f to each item of a list of T and return the list of U (higher-order map). T and U are type arguments: core.list-map(T: number, U: string, f: ..., xs: ...)
core.list-map-inner: Fn(
    T: Type,
    U: Type,
    f: Fn(item: Param("T")) -> Param("U"),
    xs: List<Param("T")>,
    start: Number,
    end: Number
  ) -> List<Param("U")>  // (en) f applied to the items of xs from start (inclusive) to end (exclusive), in order (f is called in the order of the items). Splits the range in halves, so an item goes through O(log n) wrapping lambdas and the lists are copied O(n log n) in all (one item at a time with list-append, both were O(n^2))
core.list-fold: Fn(
    T: Type,
    A: Type,
    reducer: Fn(acc: Param("A"), item: Param("T")) -> Param("A"),
    init: Param("A"),
    xs: List<Param("T")>
  ) -> Param("A")  // (en) Fold a list of T from the left into a value of A, starting from init. T and A are type arguments (ja) T のリストを init から左から順に reducer で畳み込んで A の値にする. T と A は型引数
core.list-fold-inner: Fn(
    T: Type,
    A: Type,
    reducer: Fn(acc: Param("A"), item: Param("T")) -> Param("A"),
    xs: List<Param("T")>,
    start: Number,
    end: Number,
    acc: Param("A")
  ) -> Param("A")  // (en) Fold the items of xs from start (inclusive) to end (exclusive) in order. Splits the range in halves: a function variable cannot be passed on as it is (function_not_called), so each recursive call wraps reducer in a new lambda, and with the halves an item goes through O(log n) wrappers (one item at a time, the k-th item went through k wrappers, O(n^2) calls in all)
core.quote-callee: Fn(callee: @core.callee) -> @core.expression  // An expression that rebuilds the given callee as a core.callee value (used by quote)
core.quote-expression: Fn(expr: @core.expression) -> @core.expression  // An expression that rebuilds the given expression as a core.expression value (used by quote)
core.type-expression-construct: Fn(expr: @core.expression) -> @core.expression  // An expression that evaluates to the value of the type expression (a core.expression value, like quote). Unlike quote, sub-expressions that are not type expressions (type parameters, calls of parts that return types) are evaluated, and a reference to a type part stays a reference. Types are values at run time
core.type-construct-name-type-list: Fn(items: List<Record{name: String, type: @core.expression}>, index: Number) -> List<@core.expression>  // core.type-expression-construct for each item (see core.quote-name-type-list)
core.type-construct-key-value-list: Fn(items: List<Record{key: String, value: @core.expression}>, index: Number) -> List<@core.expression>  // core.type-expression-construct for each item (see core.quote-key-value-list)
core.type-construct-tag-payload-type-list: Fn(
    items: List<Record{tag: String, payload_type: Union{#none, #some(@core.expression)}}>,
    index: Number
  ) -> List<@core.expression>  // (en) core.type-expression-construct for each item (see core.quote-tag-payload-type-list) (ja) 要素それぞれに core.type-expression-construct する (core.quote-tag-payload-type-list と同じ形)
core.quote-pattern: Fn(pattern: @core.pattern) -> @core.expression  // Expression that builds the pattern value (for quote)
core.quote-name-type-list: Fn(items: List<Record{name: String, type: @core.expression}>, index: Number) -> List<@core.expression>  // Expressions that rebuild each item of the list from the index (used by quote)
core.quote-key-value-list: Fn(items: List<Record{key: String, value: @core.expression}>, index: Number) -> List<@core.expression>  // Expressions that rebuild each item of the list from the index (used by quote)
core.quote-tag-payload-type-list: Fn(
    items: List<Record{tag: String, payload_type: Union{#none, #some(@core.expression)}}>,
    index: Number
  ) -> List<@core.expression>  // (en) Expressions that rebuild each item of the list from the index (used by quote) (ja) リストの index 以降の各要素を組み立てる式のリスト (quote で使う)
core.quote-expression-list: Fn(items: List<@core.expression>, index: Number) -> List<@core.expression>  // Expressions that rebuild each item of the list from the index (used by quote)
core.quote-name-value-list: Fn(items: List<Record{name: String, value: @core.expression}>, index: Number) -> List<@core.expression>  // Expressions that rebuild each item of the list from the index (used by quote)
core.quote-parameter-id-parameter-name-list: Fn(items: List<Record{parameter_id: Number, parameter_name: String}>, index: Number) -> List<@core.expression>  // Expressions that rebuild each item of the list from the index (used by quote)
core.quote-match-arm-list: Fn(items: List<@core.match-arm>, index: Number) -> List<@core.expression>  // Expressions that build the match arms (for quote)
core.quote-find-part: Fn(parts: List<Record{id: String, expression: @core.expression}>, id: String, index: Number) -> List<Record{id: String, expression: @core.expression}>  // The part with the id (a list of 0 or 1 item)
core.quote-part-ids: Fn(
    expr: @core.expression,
    found: List<String>,
    parts: List<Record{id: String, expression: @core.expression}>
  ) -> List<String>  // (en) Adds the ids of the parts the expression references (following the references) to found (ja) 式が (参照先をたどって) 参照するパーツの id を found に足したもの
core.quote-part-ids-in-list: Fn(
    items: List<@core.expression>,
    index: Number,
    found: List<String>,
    parts: List<Record{id: String, expression: @core.expression}>
  ) -> List<String>  // (en) core.quote-part-ids for each expression of the list from the index (ja) リストの index 以降の各式に core.quote-part-ids をしたもの
core.quote-string-list: Fn(items: List<String>, index: Number) -> List<@core.expression>  // Expressions that rebuild each string of the list from the index (used by quote)
core.quote-value: Fn(expression: @core.expression, parts: List<Record{id: String, expression: @core.expression}>) -> @core.expression  // The expression that quote(expression) means: it builds the core.code value { expression, part_ids } (part_ids are the referenced parts found in parts, following the references)
core.event-rejection: Type  // Why a signed event is rejected (core.check-event). See docs/event.md
core.event-check-state: Type  // What the server knows before accepting an event. For a project snapshot: the latest snapshot of the branch (none if the branch is new), whether the account created the branch, whether merged_commit_hash is a snapshot of the project, the module names of the snapshot that belong to other projects, whether parent_commit_hash is a snapshot of the project, and whether the project has any snapshot. See docs/project.md and docs/branch.md
core.option-string-same: Fn(a: Union{#none, #some(String)}, b: Union{#none, #some(String)}) -> Boolean  // Whether both are none, or both are some with the same string
core.check-event-module-names: Fn(
    modules: List<@core.project-snapshot-module>,
    others: List<String>,
    seen: List<String>,
    index: Number
  ) -> List<@core.event-rejection>  // (en) Rejects empty or duplicated module names in a project snapshot and module names that belong to other projects (others), from index, and checks the part names of each module. seen is the names before index. See docs/project.md (ja) プロジェクトのスナップショットのモジュール名が空・重複していないか, 他のプロジェクトのもの (others) でないかを index から調べ, 各モジュールのパーツ名も調べる. seen は index より前の名前. docs/project.md を参照
core.check-event-part-names: Fn(parts: List<@core.module-snapshot-part>, seen: List<String>, index: Number) -> List<@core.event-rejection>  // Rejects empty or duplicated part names in a module of a project snapshot, from index. seen is the names before index
core.check-event-in-state: Fn(content: @core.event-content, state: @core.event-check-state) -> List<@core.event-rejection>  // The rules of core.check-event given what they know (core.event-check-state, derived by core.event-check-state-of). See docs/event.md. Sending create_account again changes the account name (the newest one is the name)
core.type-declaration-entry: Type  // A type part declaration given to core.value-conforms: the part ID and its declaration (the expression of the type part)
core.type-declaration-find: Fn(declarations: List<@core.type-declaration-entry>, id: String, index: Number) -> Union{#none, #some(@core.expression)}  // The declaration of the type part id, from index
core.value-record-field: Fn(fields: List<Record{key: String, value: @core.value}>, key: String, index: Number) -> Union{#none, #some(@core.value)}  // The field key of a record value (core.value), from index
core.declared-fields-have-key: Fn(declared: List<Record{key: String, value: @core.expression}>, key: String, index: Number) -> Boolean  // Whether the record declaration has the key, from index
core.value-record-keys-declared: Fn(
    fields: List<Record{key: String, value: @core.value}>,
    declared: List<Record{key: String, value: @core.expression}>,
    index: Number
  ) -> Boolean  // (en) Whether every key of the record value from index is declared (ja) レコードの値の index からのキーがすべて宣言にあるか
core.value-record-fields-conform: Fn(
    fields: List<Record{key: String, value: @core.value}>,
    declared: List<Record{key: String, value: @core.expression}>,
    declarations: List<@core.type-declaration-entry>,
    index: Number
  ) -> Boolean  // (en) Whether the record value has every declared field from index, of the declared type (ja) レコードの値が宣言の index からのフィールドをすべて宣言の形で持つか
core.value-list-items-conform: Fn(
    items: List<@core.value>,
    item_type: @core.expression,
    declarations: List<@core.type-declaration-entry>,
    index: Number
  ) -> Boolean  // (en) Whether the items of a list value from index are all of item_type (ja) リストの値の index からの要素がすべて item_type の形か
core.declared-variant-find: Fn(
    variants: List<Record{tag: String, payload_type: Union{#none, #some(@core.expression)}}>,
    tag: String,
    index: Number
  ) -> Union{#none, #some(Record{tag: String, payload_type: Union{#none, #some(@core.expression)}})}  // (en) The variant tag of a union declaration, from index (ja) 直和型の宣言のバリアント tag を index から探す
core.value-conforms: Fn(
    value: @core.value,
    declaration: @core.expression,
    declarations: List<@core.type-declaration-entry>
  ) -> Boolean  // (en) Whether the value (core.value) has the shape of the type part declaration (the expression of a type part). References to type parts are looked up in declarations; unknown ones accept any value. The server checks the shape of submitted events with this. See docs/event.md (ja) 値 (core.value) が型パーツの宣言 (型パーツの式) の形か. 型パーツの参照は declarations で引き, 無いものはどんな値でもよい. サーバーは受け取ったイベントの形をこれで調べる. docs/event.md を参照
core.event-check-facts: Type  // What the server gives core.check-event: the account of the event, whether it has created the account, and the project snapshots it has accepted (in the order of the store; empty unless the event is a project snapshot). See docs/event.md
core.other-project-module-names: Fn(commits: List<@core.snapshot-summary>, project_name: String, index: Number) -> List<String>  // The module names of the latest snapshot of every branch of the projects other than project_name, from index (docs/project.md)
core.strings-in: Fn(items: List<String>, set: List<String>, index: Number) -> List<String>  // The items from index that are in set
core.event-check-state-of: Fn(commit: @core.project-snapshot, facts: @core.event-check-facts) -> @core.event-check-state  // What the rules know about a project snapshot, from the snapshots the server has accepted: the latest snapshot of the branch, whether the account created the branch (made its first snapshot), and so on. See docs/branch.md and docs/project.md
core.check-event: Fn(content: @core.event-content, facts: @core.event-check-facts) -> List<@core.event-rejection>  // Rules for accepting a signed event (after the signature and the shape are checked). The server gives only the facts it has stored (core.event-check-facts); what the rules use is derived here (core.event-check-state-of). Returns the reasons to reject it (empty means accept). The server runs this on SubmitEvent. See docs/event.md
core.check-event-branch: Fn(commit: @core.project-snapshot, state: @core.event-check-state) -> List<@core.event-rejection>  // Branch rules of a project snapshot: only the creator of a branch can take snapshots on it, and the parent is the latest snapshot of the branch. A new branch starts from a snapshot of the project, and the first branch of a project is main without a parent. See docs/branch.md
core.check-event-merge: Fn(commit: @core.project-snapshot, state: @core.event-check-state) -> List<@core.event-rejection>  // Merge rule of a project snapshot: a snapshot that merges another branch (merged_commit_hash) must merge a snapshot of the same project. See docs/branch.md
core.branch-summary: Type  // A branch of a project, summarized by core.project-branches: the creator (the account of the first snapshot; only it can take snapshots on the branch), the latest snapshot (for the same time the earlier one) and the number of snapshots. See docs/branch.md
core.branch-summaries-have: Fn(branches: List<@core.branch-summary>, project_name: String, branch: String, index: Number) -> Boolean  // Whether the branch of the project is in branches, from index
core.project-branches-from: Fn(commits: List<@core.snapshot-summary>, index: Number, branches: List<@core.branch-summary>) -> List<@core.branch-summary>  // Adds to branches the branches of the snapshots from index that are not in it yet (core.project-branches)
core.project-branches: Fn(commits: List<@core.snapshot-summary>) -> List<@core.branch-summary>  // Summarizes the project snapshots the server has accepted (in the order of the store) into the branches of every project, in the order they first appear. The server answers GetProjectBranches and finds the latest snapshot of main with this. See docs/branch.md
core.visibility-target: Type  // A part that may be referenced, given to core.check-reference-visibility: the part ID, the name (module.part), the module, the project and the visibility of the part and of its module
core.visibility-checked-part: Type  // A part in the snapshot checked by core.check-reference-visibility: like core.visibility-target (in the project of the snapshot), with the type and the expression whose part references are checked
core.visibility-violation-reason: Type  // Why a part cannot be referenced: it is private (and in another module), or it is in a private module of another project. See docs/visibility.md
core.visibility-violation: Type  // A reference to a part that cannot be referenced (core.check-reference-visibility): the referencing part and the referenced part (module.part)
core.reference-violation: Fn(project_name: String, module_name: String, target: @core.visibility-target) -> Union{#none, #some(@core.visibility-violation-reason)}  // Why a part of the module of the project cannot reference target, or none if it can. A private part can be referenced only from its module, and a part of a private module only from its project. See docs/visibility.md
core.expression-part-references-in-list: Fn(items: List<@core.expression>, index: Number, ids: List<String>) -> List<String>  // Adds to ids the part IDs that the expressions from index reference (core.expression-part-references)
core.type-function-parameter-types: Fn(parameters: List<Record{name: String, type: @core.expression}>, index: Number) -> List<@core.expression>  // The types of the parameters of a function type (expression) from index
core.type-union-payload-types: Fn(
    variants: List<Record{tag: String, payload_type: Union{#none, #some(@core.expression)}}>,
    index: Number
  ) -> List<@core.expression>  // (en) The payload types of the variants of a union type (expression) from index (ja) 直和型 (式) の index からのバリアントのペイロードの型
core.expression-part-references: Fn(expr: @core.expression, ids: List<String>) -> List<String>  // Adds to ids the part IDs that the expression references (part_reference), also in type expressions and quotes. Each ID is added once
core.expression-list-contains-hole: Fn(items: List<@core.expression>, index: Number) -> Boolean  // Whether any expression from index has an unfilled hole (start with index 0)
core.expression-hole-count: Fn(expr: @core.expression) -> Number  // The number of unfilled holes in the expression
core.option-expression-probe-hole: Fn(expr: Union{#none, #some(@core.expression)}, index: Number) -> Record{expression: Union{#none, #some(@core.expression)}, index: Number}  // core.expression-probe-hole for an optional expression
core.expressions-probe-hole: Fn(items: List<@core.expression>, index: Number) -> Record{items: List<@core.expression>, index: Number}  // core.expression-probe-hole for each expression in order

301–400 (of 499) Previous 100 Next 100