hydra.scoping module

Graph context extension and type scheme conversion.

hydra.scoping.extend_graph_for_lambda(g: Graph, lam: Lambda) Graph

Extend a graph by descending into a lambda body.

hydra.scoping.extend_graph_for_let(for_binding: Callable[[Graph, Binding], object], g: Graph, letrec: Let) Graph

Extend a graph by descending into a let body.

hydra.scoping.extend_graph_for_type_lambda(g: Graph, tlam: TypeLambda) Graph

Extend a graph by descending into a type lambda body.

hydra.scoping.extend_graph_with_bindings(bindings: Sequence[Binding], g: Graph) Graph

Add bindings to an existing graph.

hydra.scoping.f_type_to_type_scheme(typ: Type) TypeScheme

Convert a forall type to a type scheme.

hydra.scoping.term_signature_to_type_scheme(sig: TermSignature) TypeScheme

Convert a TermSignature to a TypeScheme, erasing parameter names, descriptions, and laziness flags.

hydra.scoping.type_scheme_to_f_type(ts: TypeScheme) Type

Convert a type scheme to a forall type.

hydra.scoping.type_scheme_to_term_signature(ts: TypeScheme) TermSignature

Convert a TypeScheme to a TermSignature. Type variables and class constraints are preserved exactly. Value-parameter names are synthesized as arg0, arg1, …. Per-parameter descriptions are nothing and isLazy defaults to false.