import * as tsplus_module_1 from "@tsplus/stdlib/data/Tuple/make";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Duration";
import * as tsplus_module_3 from "@effect/core/io/Schedule/operations/unfold";
import * as tsplus_module_4 from "@effect/core/io/Schedule/operations/map";
import * as tsplus_module_5 from "@effect/core/io/Schedule/operations/delayedUsing";
/**
 * A schedule that always recurs, increasing delays by summing the preceding
 * two delays (similar to the fibonacci sequence). Returns the current
 * duration between recurrences.
 *
 * @tsplus static ets/Schedule/Ops fibonacci
 */

export function fibonacci(one) {
  return tsplus_module_5.delayedUsing(tsplus_module_4.map_(tsplus_module_3.unfold(tsplus_module_1.make(one, one), ({
    tuple: [a1, a2]
  }) => tsplus_module_1.make(a2, tsplus_module_2.add_(a1, a2))), out => out.get(0)));
}
//# sourceMappingURL=fibonacci.mjs.map