// Iteration
module ck/iterck/iter

import std/core/undivstd/core/undiv

// Iterate over integers in decreasing order.
// Do nothing if `start` < `end`.
pub fun forevck/iter/forev: forall<e> (start : int, end : int, action : (int) -> e ()) -> e ()(startstart: int: intstd/core/types/int: V, endend: int: intstd/core/types/int: V, actionaction: (int) -> $14 (): intstd/core/types/int: V -> ee: E (std/core/types/unit: V)std/core/types/unit: V)result: -> 81 (): ee: E (std/core/types/unit: V)std/core/types/unit: V
  if startstart: int >=std/core/int/(>=): (x : int, y : int) -> $14 bool endend: int then
    actionaction: (int) -> $14 ()(startstart: int)
    forevck/iter/forev: (start : int, end : int, action : (int) -> $14 ()) -> $14 ()(startstart: int.decstd/core/int/dec: (i : int) -> $14 int.pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> $14 int, endend: int, actionaction: (int) -> $14 ())std/core/types/Unit: ()