18 lines
662 B
Rust
18 lines
662 B
Rust
use crate::func::Monad;
|
|
|
|
/// Basic support for tracing events across the execution.
|
|
pub trait Diagnostic<'a, T: Monad<'a>> {
|
|
/// Specify that the evaluation happens after a specific event.
|
|
fn after<'b, A: 'a>(fa: T::F<A>, event: impl 'b + FnOnce() -> String) -> T::F<A>
|
|
where
|
|
'a: 'b;
|
|
/// Specify that the evaluation happens before a specific event.
|
|
fn before<'b, A: 'a>(fa: T::F<A>, event: impl 'b + FnOnce() -> String) -> T::F<A>
|
|
where
|
|
'a: 'b;
|
|
/// Label the evaluation step as a specific named action.
|
|
fn wrapped<'b, A: 'a>(fa: T::F<A>, event: impl 'b + FnOnce() -> String) -> T::F<A>
|
|
where
|
|
'a: 'b;
|
|
}
|