Liking cljdoc? Tell your friends :D
Clojure only.

souther.encode

Encoding Souther-generated values back to Clojure data -- the inverse of souther.decode.

Every generated type has a public encoder() that yields its external representation: a newtype encodes to its bare underlying value, a record/sum to a map (with nested newtypes already unwrapped). That is exactly the unwrapping a Clojure boundary wants, so encode runs the encoder and hands back Clojure data -- no chains of .value / field accessors.

Encoding Souther-generated values back to Clojure data -- the inverse of `souther.decode`.

Every generated type has a public `encoder()` that yields its external representation: a newtype
encodes to its bare underlying value, a record/sum to a map (with nested newtypes already
unwrapped). That is exactly the unwrapping a Clojure boundary wants, so `encode` runs the
encoder and hands back Clojure data -- no chains of `.value` / field accessors.
raw docstring

encodeclj

(encode value)

Encode a Souther-generated value to Clojure data through its generated encoder(). A newtype becomes its bare underlying value; a record/sum becomes a keyword-keyed map with nested newtypes already unwrapped. The inverse of souther.decode/decode.

Encode a Souther-generated `value` to Clojure data through its generated `encoder()`. A newtype
becomes its bare underlying value; a record/sum becomes a keyword-keyed map with nested newtypes
already unwrapped. The inverse of `souther.decode/decode`.
raw docstring

unwrapclj

(unwrap value)

The bare value inside a newtype wrapper, via encode. Throws if value is not a single-value wrapper (its encoded form is a map/list), so a call site reads as a claim that the value is a newtype.

The bare value inside a newtype wrapper, via `encode`. Throws if `value` is not a single-value
wrapper (its encoded form is a map/list), so a call site reads as a claim that the value is a
newtype.
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