pub struct Arrow {
pub source: Type,
pub target: Type,
pub inference_context: Context,
}
Expand description
A container for an expression’s source and target types, whether or not these types are complete.
Fields§
§source: Type
The source type
target: Type
The target type
inference_context: Context
Type inference context for both types.
Implementations§
Source§impl Arrow
impl Arrow
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
Trait Implementations§
Source§impl CoreConstructible for Arrow
impl CoreConstructible for Arrow
fn iden(inference_context: &Context) -> Self
fn unit(inference_context: &Context) -> Self
fn injl(child: &Self) -> Self
fn injr(child: &Self) -> Self
fn take(child: &Self) -> Self
fn drop_(child: &Self) -> Self
fn comp(left: &Self, right: &Self) -> Result<Self, Error>
fn case(left: &Self, right: &Self) -> Result<Self, Error>
fn assertl(left: &Self, _: Cmr) -> Result<Self, Error>
fn assertr(_: Cmr, right: &Self) -> Result<Self, Error>
fn pair(left: &Self, right: &Self) -> Result<Self, Error>
fn fail(inference_context: &Context, _: FailEntropy) -> Self
fn const_word(inference_context: &Context, word: Word) -> Self
Source§fn inference_context(&self) -> &Context
fn inference_context(&self) -> &Context
Accessor for the type inference context used to create the object.
Source§fn scribe(ctx: &Context, value: &Value) -> Self
fn scribe(ctx: &Context, value: &Value) -> Self
Create an expression that produces the given
value
. Read moreSource§fn bit_false(inference_context: &Context) -> Self
fn bit_false(inference_context: &Context) -> Self
Create a DAG that takes any input and returns bit
0
as constant output. Read moreSource§fn bit_true(inference_context: &Context) -> Self
fn bit_true(inference_context: &Context) -> Self
Create a DAG that takes any input and returns bit
1
as constant output. Read moreSource§fn cond(left: &Self, right: &Self) -> Result<Self, Error>
fn cond(left: &Self, right: &Self) -> Result<Self, Error>
Create a DAG that takes a bit and an input,
such that the
left
child is evaluated on the input if the bit is 1
(if branch)
and the right
child is evaluated on the input otherwise (else branch). Read moreSource§fn assert(child: &Self, hash: Cmr) -> Result<Self, Error>
fn assert(child: &Self, hash: Cmr) -> Result<Self, Error>
Create a DAG that asserts that its child returns
true
, and fails otherwise.
The hash
identifies the assertion and is returned upon failure. Read moreSource§fn not(child: &Self) -> Result<Self, Error>
fn not(child: &Self) -> Result<Self, Error>
Create a DAG that computes Boolean NOT of the
child
. Read moreSource§impl DisconnectConstructible<Arrow> for Arrow
impl DisconnectConstructible<Arrow> for Arrow
fn disconnect(left: &Self, right: &Self) -> Result<Self, Error>
Source§impl DisconnectConstructible<NoDisconnect> for Arrow
impl DisconnectConstructible<NoDisconnect> for Arrow
fn disconnect(left: &Self, _: &NoDisconnect) -> Result<Self, Error>
Source§impl<J: Jet> JetConstructible<J> for Arrow
impl<J: Jet> JetConstructible<J> for Arrow
Auto Trait Implementations§
impl Freeze for Arrow
impl RefUnwindSafe for Arrow
impl Send for Arrow
impl Sync for Arrow
impl Unpin for Arrow
impl UnwindSafe for Arrow
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