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

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

export type Color =
    { readonly tag: "Red" }
  | { readonly tag: "Green" }
  | { readonly tag: "Blue" };

export const Color = {
  Red: { tag: "Red" } as Color,
  Green: { tag: "Green" } as Color,
  Blue: { tag: "Blue" } as Color,
};

export async function channel(c: Color): Promise<number> {
  switch (c.tag) {
    case "Red": {
      return 1;
    }
    case "Green": {
      return 2;
    }
    case "Blue": {
      return 3;
    }
  }
  throw new Error("non-exhaustive match");
}

