rep

Function rep 

Source
pub fn rep<A: Clone + 'static + FromStr, F, G>(
    vm: &mut RoundVM,
    init: F,
    fun: G,
) -> A
where F: Fn(&mut RoundVM) -> A, G: Fn(&mut RoundVM, A) -> A,
Expand description

Iteratively updates the value of the input expression at each device using the last computed value.

§Arguments

  • vm the current VM
  • init the initial value
  • fun the function to apply to the value

§Generic Parameters

  • A The type of value returned by the expression.
  • F - The type of the closure, which must be a closure that takes no arguments and returns a value of type A.
  • G - The type of the closure, which must be a closure that takes a tuple (RoundVM, A) and returns a tuple (RoundVM, A).

§Returns

the updated value