Skip to main content

ArrowLoop

Trait ArrowLoop 

Source
pub trait ArrowLoop: Arrow {
    // Required method
    fn loop_arrow<A, B, D>(f: Self::P<(A, D), (B, D)>) -> Self::P<A, B>
       where A: Clone + 'static,
             B: Clone + 'static,
             D: Default + Clone + 'static;
}
Expand description

ArrowLoop: an Arrow with a loop/fixpoint combinator.

Takes an arrow from (A, D) to (B, D) and produces an arrow from A to B, where D is the “feedback” type threaded through the loop.

In Haskell, loop relies on laziness to tie the knot. Rust is strict, so D: Default provides the initial feedback seed and the implementation uses single-pass evaluation.

Required Methods§

Source

fn loop_arrow<A, B, D>(f: Self::P<(A, D), (B, D)>) -> Self::P<A, B>
where A: Clone + 'static, B: Clone + 'static, D: Default + Clone + 'static,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§