pub fn anonymize(&self) -> Self {
        match self {
            Self::Variable {
                variable_kind,
                var,
                source_name: _,
            } => Self::Variable {
                variable_kind: variable_kind.clone(),
                var: *var,
                source_name: None,
            },
            Self::RecordOpen {
                kind,
                var,
                source_name: _,
                row,
            } => Self::RecordOpen {
                kind: kind.clone(),
                var: *var,
                source_name: None,
                row: row
                    .iter()
                    .map(|(label, t)| (label.clone(), t.anonymize()))
                    .collect(),
            },
            Self::RecordClosed { kind, row } => Self::RecordClosed {
                kind: kind.clone(),
                row: row
                    .iter()
                    .map(|(label, t)| (label.clone(), t.anonymize()))
                    .collect(),
            },
            Self::Call {
                function,
                arguments,
            } => Self::Call {
                function: Box::new(function.anonymize()),
                arguments: unsafe {
                    NonEmpty::new_unchecked(arguments.iter().map(|arg| arg.anonymize()).collect())
                },
            },
            Self::Function {
                parameters,
                return_type,
            } => Self::Function {
                parameters: parameters.iter().map(|param| param.anonymize()).collect(),
                return_type: Box::new(return_type.anonymize()),
            },
            Self::PrimConstructor { .. } | Self::Constructor { .. } => self.clone(),
        }
    }
/// Removes any type variable names.
Removes any type variable names.
Removes any type variable names .
pub fn anonymize(&self) -> Self {
        match self {
            Self::Variable {
                variable_kind,
                var,
                source_name: _,
            } => Self::Variable {
                variable_kind: variable_kind.clone(),
                var: *var,
                source_name: None,
            },
            Self::RecordOpen {
                kind,
                var,
                source_name: _,
                row,
            } => Self::RecordOpen {
                kind: kind.clone(),
                var: *var,
                source_name: None,
                row: row
                    .iter()
                    .map(|(label, t)| (label.clone(), t.anonymize()))
                    .collect(),
            },
            Self::RecordClosed { kind, row } => Self::RecordClosed {
                kind: kind.clone(),
                row: row
                    .iter()
                    .map(|(label, t)| (label.clone(), t.anonymize()))
                    .collect(),
            },
            Self::Call {
                function,
                arguments,
            } => Self::Call {
                function: Box::new(function.anonymize()),
                arguments: unsafe {
                    NonEmpty::new_unchecked(arguments.iter().map(|arg| arg.anonymize()).collect())
                },
            },
            Self::Function {
                parameters,
                return_type,
            } => Self::Function {
                parameters: parameters.iter().map(|param| param.anonymize()).collect(),
                return_type: Box::new(return_type.anonymize()),
            },
            Self::PrimConstructor { .. } | Self::Constructor { .. } => self.clone(),
        }
    }
pub fn anonymize ( & self ) -> Self { match self { Self :: Variable { variable_kind , var , source_name : _ , } => Self :: Variable { variable_kind : variable_kind . clone ( ) , var : * var , source_name : None , } , Self :: RecordOpen { kind , var , source_name : _ , row , } => Self :: RecordOpen { kind : kind . clone ( ) , var : * var , source_name : None , row : row . iter ( ) . map ( | ( label , t ) | ( label . clone ( ) , t . anonymize ( ) ) ) . collect ( ) , } , Self :: RecordClosed { kind , row } => Self :: RecordClosed { kind : kind . clone ( ) , row : row . iter ( ) . map ( | ( label , t ) | ( label . clone ( ) , t . anonymize ( ) ) ) . collect ( ) , } , Self :: Call { function , arguments , } => Self :: Call { function : Box :: new ( function . anonymize ( ) ) , arguments : unsafe { NonEmpty :: new_unchecked ( arguments . iter ( ) . map ( | arg | arg . anonymize ( ) ) . collect ( ) ) } , } , Self :: Function { parameters , return_type , } => Self :: Function { parameters : parameters . iter ( ) . map ( | param | param . anonymize ( ) ) . collect ( ) , return_type : Box :: new ( return_type . anonymize ( ) ) , } , Self :: PrimConstructor { .. } | Self :: Constructor { .. } => self . clone ( ) , } }
Removes any type variable names.
Removes any type variable names .
&self
&self