Skip to content

Subtype Ternary enum #2351

@schuler-henry

Description

@schuler-henry

Maybe we could subtype Ternary by reassigning Ternary.Always = true, Ternary.Never = false, Ternary.Maybe = Symbol('maybe') and have helper methods for the type to have helpers like toBool(maybeAs: boolean), alwaysOrMaybe(), onTernary<T>(tru: () => T, ...), and(a: Ternary, b: Ternary).

Originally posted by @EagleoutIce in #2321 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions