hydra-kernel-0.18.1: hydra-kernel-json/hydra/core/typing.json
{
"name": "hydra.core.typing",
"metadata": {
"description": "Types supporting type inference and type reconstruction.",
"comments": [],
"seeAlso": [],
"provisions": []},
"dependencies": [{"module": "hydra.core.model"}, {"module": "hydra.core.paths"}],
"definitions": [
{
"type": {
"name": "hydra.core.typing.FunctionStructure",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {
"forall": {
"parameter": "env",
"body": {
"record": [
{
"name": "typeParams",
"type": {
"annotated": {
"body": {"list": {"variable": "hydra.core.model.Name"}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Type parameters (from type lambdas)"}}}]}}}},
{
"name": "params",
"type": {
"annotated": {
"body": {"list": {"variable": "hydra.core.model.Name"}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Value parameters (from lambdas)"}}}]}}}},
{
"name": "bindings",
"type": {
"annotated": {
"body": {"list": {"variable": "hydra.core.model.Binding"}},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Let bindings accumulated from the term"}}}]}}}},
{
"name": "body",
"type": {
"annotated": {
"body": {"variable": "hydra.core.model.Term"},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "The body term after removing all lambdas, lets, etc."}}}]}}}},
{
"name": "domains",
"type": {
"annotated": {
"body": {"list": {"variable": "hydra.core.model.Type"}},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Domain types of the value parameters"}}}]}}}},
{
"name": "codomain",
"type": {
"annotated": {
"body": {"optional": {"variable": "hydra.core.model.Type"}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "The return type of the function (if type inference succeeded)"}}}]}}}},
{
"name": "environment",
"type": {
"annotated": {
"body": {"variable": "env"},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Updated environment after processing all bindings"}}}]}}}}]}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "A structured representation of a function term's components, replacing ad-hoc tuples. This captures all the information extracted from peeling lambdas, type lambdas, lets, and type applications from a term."}}}]}}},
"constraints": []}}},
{
"type": {
"name": "hydra.core.typing.InferenceContext",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {
"record": [
{
"name": "freshTypeVariableCount",
"type": {
"annotated": {
"body": {"literal": {"integer": "int32"}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Counter used to generate distinct fresh type variables during inference"}}}]}}}},
{
"name": "trace",
"type": {
"annotated": {
"body": {"list": {"variable": "hydra.core.paths.SubtermStep"}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "The current subterm-path trace, accumulated backwards (head = most-recently-pushed step, corresponding to the deepest point in the descent). At the moment an inference error is constructed, the list is reversed and wrapped into a SubtermPath (root-to-leaf order) and stamped onto the error."}}}]}}}}]},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "State threaded through type inference: the fresh type variable counter and the current subterm-path trace."}}}]}}},
"constraints": []}}},
{
"type": {
"name": "hydra.core.typing.InferenceResult",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {
"record": [
{
"name": "term",
"type": {
"annotated": {
"body": {"variable": "hydra.core.model.Term"},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "The term which was inferred"}}}]}}}},
{
"name": "type",
"type": {
"annotated": {
"body": {"variable": "hydra.core.model.Type"},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "The inferred type of the term"}}}]}}}},
{
"name": "subst",
"type": {
"annotated": {
"body": {"variable": "hydra.core.typing.TypeSubst"},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "The type substitution resulting from unification"}}}]}}}},
{
"name": "classConstraints",
"type": {
"annotated": {
"body": {
"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.TypeVariableConstraints"}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Class constraints discovered during inference (e.g., Ord constraints from Map.lookup)"}}}]}}}},
{
"name": "context",
"type": {
"annotated": {
"body": {"variable": "hydra.core.typing.InferenceContext"},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "The updated InferenceContext after inference (carries fresh-variable counter and trace)"}}}]}}}}]},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "The result of applying inference rules to a term."}}}]}}},
"constraints": []}}},
{
"type": {
"name": "hydra.core.typing.Parameter",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {
"record": [
{
"name": "name",
"type": {
"annotated": {
"body": {"variable": "hydra.core.model.Name"},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "The name of the parameter"}}}]}}}},
{
"name": "description",
"type": {
"annotated": {
"body": {"optional": {"literal": "string"}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "An optional human-readable description of the parameter"}}}]}}}},
{
"name": "type",
"type": {
"annotated": {
"body": {"variable": "hydra.core.model.Type"},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "The type of the parameter"}}}]}}}},
{
"name": "isLazy",
"type": {
"annotated": {
"body": {"literal": "boolean"},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Whether the parameter must be passed lazily (thunked) at call sites in hosts that distinguish strict from lazy evaluation"}}}]}}}}]},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "A named, typed parameter of a term, with optional human-readable description and a flag indicating whether the parameter requires lazy evaluation by hosts which support it."}}}]}}},
"constraints": []}}},
{
"type": {
"name": "hydra.core.typing.Result",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {
"record": [
{
"name": "description",
"type": {
"annotated": {
"body": {"optional": {"literal": "string"}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "An optional human-readable description of the result"}}}]}}}},
{
"name": "type",
"type": {
"annotated": {
"body": {"variable": "hydra.core.model.Type"},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "The type of the result"}}}]}}}}]},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "The result of a term, consisting of a type and an optional human-readable description."}}}]}}},
"constraints": []}}},
{
"type": {
"name": "hydra.core.typing.TermSignature",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {
"record": [
{
"name": "typeParameters",
"type": {
"annotated": {
"body": {"list": {"variable": "hydra.core.typing.TypeParameter"}},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "The type parameters of the term, in order"}}}]}}}},
{
"name": "parameters",
"type": {
"annotated": {
"body": {"list": {"variable": "hydra.core.typing.Parameter"}},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "The value parameters of the term, in order"}}}]}}}},
{
"name": "result",
"type": {
"annotated": {
"body": {"variable": "hydra.core.typing.Result"},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "The result of the term"}}}]}}}}]},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "A structured signature for a term: an ordered list of type parameters (with optional class constraints), an ordered list of value parameters, and a result. TermSignature is a richer view of TypeScheme: every TermSignature can be converted to a TypeScheme by erasing parameter names, descriptions, and laziness flags."}}}]}}},
"constraints": []}}},
{
"type": {
"name": "hydra.core.typing.TermSubst",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {"wrap": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Term"}}}},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "A substitution of term variables for terms"}}}]}}},
"constraints": []}}},
{
"type": {
"name": "hydra.core.typing.TypeClass",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {
"record": [
{
"name": "description",
"type": {
"annotated": {
"body": {"literal": "string"},
"annotation": {
"map": [
{"key": {"variable": "description"}, "value": {"literal": {"string": "A human-readable description of the type class"}}}]}}}}]},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "A type class identifier together with a human-readable description. Type classes are referenced as bare names (e.g. the local name \"equality\") in TypeVariableConstraints.classes; the canonical definitions live as term bindings under hydra.core.classes."}}}]}}},
"constraints": []}}},
{
"type": {
"name": "hydra.core.typing.TypeConstraint",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {
"record": [
{
"name": "left",
"type": {
"annotated": {
"body": {"variable": "hydra.core.model.Type"},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "The left-hand side of the constraint"}}}]}}}},
{
"name": "right",
"type": {
"annotated": {
"body": {"variable": "hydra.core.model.Type"},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "The right-hand side of the constraint"}}}]}}}},
{
"name": "comment",
"type": {
"annotated": {
"body": {"literal": "string"},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "A description of the type constraint which may be used for tracing or debugging"}}}]}}}}]},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "An assertion that two types can be unified into a single type"}}}]}}},
"constraints": []}}},
{
"type": {
"name": "hydra.core.typing.TypeParameter",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {
"record": [
{
"name": "name",
"type": {
"annotated": {
"body": {"variable": "hydra.core.model.Name"},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "The name of the type parameter"}}}]}}}},
{
"name": "constraints",
"type": {
"annotated": {
"body": {"list": {"variable": "hydra.core.model.TypeClassConstraint"}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Any type class constraints on the type parameter"}}}]}}}}]},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "A type parameter of a term, with an optional list of type class constraints"}}}]}}},
"constraints": []}}},
{
"type": {
"name": "hydra.core.typing.TypeSubst",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {"wrap": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Type"}}}},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "A substitution of type variables for types"}}}]}}},
"constraints": []}}}]}