1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::func::Monad;

/// Basic support for tracing events across the execution.
pub trait Diagnostic<'a, T: Monad<'a>>: 'a + Send {
    /// Specify that the evaluation happens after a specific event.
    fn after<'b, A: 'a + Send>(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 + Send>(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 + Send>(fa: T::F<A>, event: impl 'b + FnOnce() -> String) -> T::F<A>
    where
        'a: 'b;
}