Skip to main content

ProductEtaExpander

Struct ProductEtaExpander 

Source
struct ProductEtaExpander<'a> {
    current_path: Expr,
    expr_to_eta_expansion: &'a mut UnordMap<Expr, Expr>,
}

Fields§

§current_path: Expr§expr_to_eta_expansion: &'a mut UnordMap<Expr, Expr>

Implementations§

Source§

impl<'a> ProductEtaExpander<'a>

Recursively “unpacks” a product by eta-expanding each part of it. Maps each part of the product to its eta-expanded path.

e.g.

in = {
  current_path: self,
  expr: TwoFields { 0: (a0.0, a0.1), 1: 42 })
}

out =
  a0.0 => self.0.0
  a0.1 => self.0.1
  42 => self.1
Source

fn eta_expand_products( current_path: Expr, expr: Expr, expr_to_eta_expansion: &'a mut UnordMap<Expr, Expr>, )

Trait Implementations§

Source§

impl TypeVisitor for ProductEtaExpander<'_>

Source§

fn visit_expr(&mut self, expr: &Expr) -> ControlFlow<Self::BreakTy>

Source§

type BreakTy = !

Source§

fn enter_binder(&mut self, _vars: &Interned<[BoundVariableKind]>)

Source§

fn exit_binder(&mut self)

Source§

fn visit_sort(&mut self, sort: &Sort) -> ControlFlow<Self::BreakTy>

Source§

fn visit_ty(&mut self, ty: &Ty) -> ControlFlow<Self::BreakTy>

Source§

fn visit_bty(&mut self, bty: &BaseTy) -> ControlFlow<Self::BreakTy>

Auto Trait Implementations§

§

impl<'a> Freeze for ProductEtaExpander<'a>

§

impl<'a> RefUnwindSafe for ProductEtaExpander<'a>

§

impl<'a> Send for ProductEtaExpander<'a>

§

impl<'a> Sync for ProductEtaExpander<'a>

§

impl<'a> Unpin for ProductEtaExpander<'a>

§

impl<'a> !UnwindSafe for ProductEtaExpander<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more