Expand builder (#20)
* Add bool method * Add proptest * Add some more consts and stuff * Refactor Lambda stuff out * REfactor * Convert bytestring test to prop test * Add string constant * Add char stuff, despite it not being ready * Add unit * Add var * Add delay * Add apply * Add force * Add error * Add builtin * Add example, remove feature * Rename some stuff Co-authored-by: Turner <mitch@tpfs.io>
This commit is contained in:
15
crates/uplc/examples/identity_builder_ext.rs
Normal file
15
crates/uplc/examples/identity_builder_ext.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use uplc::program_builder::{Builder, WithLambda, WithTerm, WithVar};
|
||||
|
||||
trait WithIdentity: WithTerm + WithLambda + WithVar {
|
||||
fn with_identity(self, name_str: &str) -> Self::Next {
|
||||
self.with_lambda(name_str).with_var(name_str)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: WithTerm> WithIdentity for T {}
|
||||
|
||||
fn main() {
|
||||
let my_var = "some_var";
|
||||
let program = Builder::start(1, 2, 3).with_identity(my_var).build_named();
|
||||
println!("{:#?}", program);
|
||||
}
|
||||
Reference in New Issue
Block a user