Generic Enums

Enums can be generic, taking type parameters. This lets you create reusable patterns like Option[T] for optional values or Result[T, E] for error handling.

Generic enums combine the power of sum types with Go's generics. The type parameter is specified in square brackets. Unit variants like Option.None infer the type from context (e.g., the return type).

Try it: Create a Result[T, E] enum with Ok and Err variants.