pub struct Arrow<'brand> {
pub source: Type<'brand>,
pub target: Type<'brand>,
pub inference_context: Context<'brand>,
}Expand description
A container for an expression’s source and target types, whether or not these types are complete.
Fields§
§source: Type<'brand>The source type
target: Type<'brand>The target type
inference_context: Context<'brand>Type inference context for both types.
Implementations§
Source§impl<'brand> Arrow<'brand>
impl<'brand> Arrow<'brand>
Sourcepub fn finalize(&self) -> Result<FinalArrow, Error>
pub fn finalize(&self) -> Result<FinalArrow, Error>
Finalize the source and target types in the arrow
Sourcepub fn shallow_clone(&self) -> Self
pub fn shallow_clone(&self) -> Self
Same as Self::clone but named to make it clearer that this is cheap
A type arrow where both source and target types are new free variables.
This should be used for hidden nodes or other nodes where nothing about the node is known.
Sourcepub fn program(inference_context: &Context<'brand>) -> Self
pub fn program(inference_context: &Context<'brand>) -> Self
A type arrow where both source and target types fixed to the unit type.
pub fn iden(inference_context: &Context<'brand>) -> Self
pub fn unit(inference_context: &Context<'brand>) -> Self
pub fn injl(child: &Self) -> Self
pub fn injr(child: &Self) -> Self
pub fn take(child: &Self) -> Self
pub fn drop_(child: &Self) -> Self
pub fn comp(left: &Self, right: &Self) -> Result<Self, Error>
pub fn case(left: &Self, right: &Self) -> Result<Self, Error>
pub fn assertl(left: &Self) -> Result<Self, Error>
pub fn assertr(right: &Self) -> Result<Self, Error>
pub fn pair(left: &Self, right: &Self) -> Result<Self, Error>
pub fn fail(inference_context: &Context<'brand>) -> Self
pub fn const_word(inference_context: &Context<'brand>, word: &Word) -> Self
pub fn jet(inference_context: &Context<'brand>, jet: &dyn Jet) -> Self
pub fn witness(inference_context: &Context<'brand>) -> Self
pub fn inference_context(&self) -> &Context<'brand>
Trait Implementations§
Source§impl<'brand> DisconnectConstructible<'brand, Arrow<'brand>> for Arrow<'brand>
impl<'brand> DisconnectConstructible<'brand, Arrow<'brand>> for Arrow<'brand>
fn disconnect(left: &Self, right: &Self) -> Result<Self, Error>
Source§impl<'brand> DisconnectConstructible<'brand, NoDisconnect> for Arrow<'brand>
impl<'brand> DisconnectConstructible<'brand, NoDisconnect> for Arrow<'brand>
fn disconnect(left: &Self, _: &NoDisconnect) -> Result<Self, Error>
Auto Trait Implementations§
impl<'brand> !RefUnwindSafe for Arrow<'brand>
impl<'brand> !UnwindSafe for Arrow<'brand>
impl<'brand> Freeze for Arrow<'brand>
impl<'brand> Send for Arrow<'brand>
impl<'brand> Sync for Arrow<'brand>
impl<'brand> Unpin for Arrow<'brand>
impl<'brand> UnsafeUnpin for Arrow<'brand>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more