The one refusal of the time core.
A refusal is an ex-info carrying :time/reason -- the CLOSED vocabulary below -- and :autonomous/error with the SAME value, so the autonomous runtime turns the throw into the right kind of refusal (autonomous.domain.answer/from-exception).
A reason outside the vocabulary is not a refusal: it is a caller defect, and becomes an ordinary ex-info with no :time/reason. A designed refusal is always recognisable; a defect never passes for one.
Closed sets are malli :enum, never hive-dsl defadt: hive-dsl 0.6.2 pulls data.json and core.async into every cljs client, too heavy to buy keyword dispatch for a handful of sets.
The one refusal of the time core. A refusal is an ex-info carrying :time/reason -- the CLOSED vocabulary below -- and :autonomous/error with the SAME value, so the autonomous runtime turns the throw into the right kind of refusal (autonomous.domain.answer/from-exception). A reason outside the vocabulary is not a refusal: it is a caller defect, and becomes an ordinary ex-info with no :time/reason. A designed refusal is always recognisable; a defect never passes for one. Closed sets are malli :enum, never hive-dsl defadt: hive-dsl 0.6.2 pulls data.json and core.async into every cljs client, too heavy to buy keyword dispatch for a handful of sets.
(attempt f & args)Run (f & args): {:ok v} on the value, {:error reason :message msg} on a refusal of this library. Any other exception (a defect) is rethrown.
Run (f & args): {:ok v} on the value, {:error reason :message msg} on a
refusal of this library. Any other exception (a defect) is rethrown.(reason e)The reason of a refusal, or nil when e is not a refusal of this library.
The reason of a refusal, or nil when `e` is not a refusal of this library.
The reason set as a malli :enum, for contracts and consumer validation.
The reason set as a malli :enum, for contracts and consumer validation.
(reason? r)True when r is in the closed reason vocabulary.
True when `r` is in the closed reason vocabulary.
The CLOSED vocabulary of refusal reasons.
Generic (day, month, period, zone, age, codecs) plus the two the ISO codec needs.
The CLOSED vocabulary of refusal reasons. Generic (day, month, period, zone, age, codecs) plus the two the ISO codec needs.
(refusal? e)True when e is a designed refusal of this library.
True when `e` is a designed refusal of this library.
(refuse reason msg)(refuse reason msg data)A refusal with reason (from the vocabulary) and msg. data joins the
ex-data. A reason outside the vocabulary is a caller defect: an ex-info
"unknown time reason", with no :time/reason.
A refusal with `reason` (from the vocabulary) and `msg`. `data` joins the ex-data. A reason outside the vocabulary is a caller defect: an ex-info "unknown time reason", with no :time/reason.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |