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

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

export function wrap(n: number): Option<number> {
  return Some(n);
}

export function empty(): Option<number> {
  return None;
}

export function extract(o: Option<number>): number {
  switch (o.tag) {
    case "Some": {
      const n = o.value;
      return n;
    }
    case "None": {
      return 0;
    }
  }
  throw new Error("non-exhaustive match");
}

