// Generated by bynkc — do not edit by hand.
// commons demo.parsing

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

export type Outcome =
    { readonly tag: "Hit"; readonly score: number }
  | { readonly tag: "Miss" };

export const Outcome = {
  Hit: (score: number): Outcome => ({ tag: "Hit", score }),
  Miss: { tag: "Miss" } as Outcome,
};

export function classify(n: number): Outcome {
  return (n === 0 ? Outcome.Miss : Outcome.Hit(n));
}

export function label(n: number): number {
  const __r0 = classify(n);
  if (__r0.tag === "Hit") {
    const score = __r0.score;
    return score;
  } else {
    return 0;
  }
}

