// Generated by bynkc — do not edit by hand.
// commons hof

import { Ok, Err, Some, None, type Result, type Option, type ValidationError } from "./runtime.js";

export function apply(f: (a0: number) => number, x: number): number {
  return f(x);
}

export function fold3(f: (a0: number, a1: number) => number, a: number, b: number, c: number): number {
  return f(f(a, b), c);
}

export function demo(): number {
  const base = apply((n) => n * 2, 10);
  return fold3((acc, t) => acc + t, base, 1, 2);
}

export function blocky(): number {
  return apply((n) => {
    const doubled = n * 2;
    return doubled + 1;
  }, 4);
}

