Liking cljdoc? Tell your friends :D

telsos.lib.enums

Compile-time exhaustiveness checking for Malli :enum schemas.

Provides macros that emit case expressions while verifying at macro-expansion time that every enum value is handled.

Usage: (def Status [:enum :draft :published :archived])

(enum-case Status status :draft (handle-draft) :published (handle-published) :archived (handle-archived))

If a branch is missing, macro expansion fails with a clear error.

Supports:

  • Var-based schema references (symbol pointing to a def)
  • Malli registry lookups (qualified keyword)
  • Inline schema literals (vector)
  • Grouped match values like (:a :b) expr
  • Optional default branch via enum-case*
Compile-time exhaustiveness checking for Malli :enum schemas.

Provides macros that emit `case` expressions while verifying at
macro-expansion time that every enum value is handled.

Usage:
  (def Status [:enum :draft :published :archived])

  (enum-case Status status
    :draft     (handle-draft)
    :published (handle-published)
    :archived  (handle-archived))

If a branch is missing, macro expansion fails with a clear error.

Supports:
  - Var-based schema references (symbol pointing to a def)
  - Malli registry lookups (qualified keyword)
  - Inline schema literals (vector)
  - Grouped match values like `(:a :b) expr`
  - Optional default branch via `enum-case*`
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close