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:
MitchTurner
2022-07-01 20:50:58 -07:00
committed by GitHub
parent 7f70ae0f74
commit ada7b00b49
16 changed files with 884 additions and 121 deletions

View 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);
}