use lubeck::common::writer::Writer; use lubeck::prelude::*; type LogWriter = Writer<'static, String, T>; fn start_logger_with(start_number: usize) -> LogWriter { Writer::new((start_number, format!("Start with {start_number}\n"))) } fn add_2_writer(add_to_this: usize) -> LogWriter { Writer::new(( add_to_this + 2, format!("Added 2 so now we have {}", add_to_this + 2), )) } fn main() { let writer_hi = start_logger_with(2); let composed_writers = writer_hi.bind(add_2_writer); let (result, log) = composed_writers.run(); println!("Result is {result}!\n=========="); println!("Recorded the following log:\n\"\n{}\n\"", log); }