pub trait CoreConstructible: Sized {
Show 21 methods // Required methods fn iden() -> Self; fn unit() -> 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, right: Cmr) -> Result<Self, Error>; fn assertr(left: Cmr, right: &Self) -> Result<Self, Error>; fn pair(left: &Self, right: &Self) -> Result<Self, Error>; fn fail(entropy: FailEntropy) -> Self; fn const_word(word: Arc<Value>) -> Self; // Provided methods fn scribe(value: &Value) -> Self { ... } fn bit_false() -> Self { ... } fn bit_true() -> Self { ... } fn cond(left: &Self, right: &Self) -> Result<Self, Error> { ... } fn assert(child: &Self, hash: Cmr) -> Result<Self, Error> { ... } fn not(child: &Self) -> Result<Self, Error> { ... } fn and(left: &Self, right: &Self) -> Result<Self, Error> { ... } fn or(left: &Self, right: &Self) -> Result<Self, Error> { ... }
}

Required Methods§

source

fn iden() -> Self

source

fn unit() -> Self

source

fn injl(child: &Self) -> Self

source

fn injr(child: &Self) -> Self

source

fn take(child: &Self) -> Self

source

fn drop_(child: &Self) -> Self

source

fn comp(left: &Self, right: &Self) -> Result<Self, Error>

source

fn case(left: &Self, right: &Self) -> Result<Self, Error>

source

fn assertl(left: &Self, right: Cmr) -> Result<Self, Error>

source

fn assertr(left: Cmr, right: &Self) -> Result<Self, Error>

source

fn pair(left: &Self, right: &Self) -> Result<Self, Error>

source

fn fail(entropy: FailEntropy) -> Self

source

fn const_word(word: Arc<Value>) -> Self

Provided Methods§

source

fn scribe(value: &Value) -> Self

Create a DAG that takes any input and returns value as constant output.

Overall type: A → B where value: B

source

fn bit_false() -> Self

Create a DAG that takes any input and returns bit 0 as constant output.

Overall type: A → 2

source

fn bit_true() -> Self

Create a DAG that takes any input and returns bit 1 as constant output.

Overall type: A → 2

source

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).

Overall type: 2 × A → B where left: A → B and right: A → B

Type inference will fail if children are not of the correct type.

source

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.

Overall type: A → 1 where child: A → 2

Type inference will fail if children are not of the correct type.

source

fn not(child: &Self) -> Result<Self, Error>

Create a DAG that computes Boolean NOT of the child.

Overall type: A → 2 where child: A → 2

Type inference will fail if children are not of the correct type.

source

fn and(left: &Self, right: &Self) -> Result<Self, Error>

Create a DAG that computes Boolean AND of the left and right child.

Overall type: A → 2 where left: A → 2 and right: A → 2

Type inference will fail if children are not of the correct type.

source

fn or(left: &Self, right: &Self) -> Result<Self, Error>

Create a DAG that computes Boolean OR of the left and right.

Overall type: A → 2 where left: A → 2 and right: A → 2

Type inference will fail if children are not of the correct type.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<N> CoreConstructible for Arc<Node<N>>

source§

fn iden() -> Self

source§

fn unit() -> Self

source§

fn injl(child: &Self) -> Self

source§

fn injr(child: &Self) -> Self

source§

fn take(child: &Self) -> Self

source§

fn drop_(child: &Self) -> Self

source§

fn comp(left: &Self, right: &Self) -> Result<Self, Error>

source§

fn case(left: &Self, right: &Self) -> Result<Self, Error>

source§

fn assertl(left: &Self, r_cmr: Cmr) -> Result<Self, Error>

source§

fn assertr(l_cmr: Cmr, right: &Self) -> Result<Self, Error>

source§

fn pair(left: &Self, right: &Self) -> Result<Self, Error>

source§

fn fail(entropy: FailEntropy) -> Self

source§

fn const_word(value: Arc<Value>) -> Self

Implementors§