Add type aliases for registries
Introduces `GlobalFunctionRegistry` and `GlobalAnalyzedRegistry` type aliases to clarify the usage of `HashMap`s for storing global functions and their analyzed versions. This change also refactors the `LambdaCollector` and `Optimizer` to use these new aliases, improving code readability and maintainability.
This commit is contained in:
@@ -60,6 +60,9 @@ pub type BoundNode<T = ()> = Node<BoundKind<T>, T>;
|
||||
/// Type alias for a node that has been fully type-checked.
|
||||
pub type TypedNode = BoundNode<StaticType>;
|
||||
|
||||
/// Type alias for the global function registry.
|
||||
pub type GlobalFunctionRegistry = std::collections::HashMap<GlobalIdx, Rc<BoundNode>>;
|
||||
|
||||
/// Metrics collected during the analysis phase.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct NodeMetrics {
|
||||
@@ -71,6 +74,9 @@ pub struct NodeMetrics {
|
||||
/// Type alias for a node that has been analyzed.
|
||||
pub type AnalyzedNode = BoundNode<NodeMetrics>;
|
||||
|
||||
/// Type alias for the global analyzed function registry.
|
||||
pub type GlobalAnalyzedRegistry = std::collections::HashMap<GlobalIdx, Rc<AnalyzedNode>>;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum BoundKind<T = ()> {
|
||||
Nop,
|
||||
|
||||
Reference in New Issue
Block a user