(clause-with-extraction-body rec__2584__auto__)(clause-with-extraction-body data__2585__auto__ v__2586__auto__)(clause-with-extraction-body rec__5541__auto__)(clause-with-extraction-body data__5542__auto__ v__5543__auto__)Lens for the body field from a ClauseWithExtraction record. See active.clojure.sum-type/make-clause-with-extraction.
Lens for the `body` field from a [[ClauseWithExtraction]] record. See [[active.clojure.sum-type/make-clause-with-extraction]].
(clause-with-extraction-constructor-symbol rec__2584__auto__)(clause-with-extraction-constructor-symbol data__2585__auto__ v__2586__auto__)(clause-with-extraction-constructor-symbol rec__5541__auto__)(clause-with-extraction-constructor-symbol data__5542__auto__ v__5543__auto__)Lens for the constructor-symbol field from a ClauseWithExtraction record. See active.clojure.sum-type/make-clause-with-extraction.
Lens for the `constructor-symbol` field from a [[ClauseWithExtraction]] record. See [[active.clojure.sum-type/make-clause-with-extraction]].
(clause-with-extraction-named-params rec__2584__auto__)(clause-with-extraction-named-params data__2585__auto__ v__2586__auto__)(clause-with-extraction-named-params rec__5541__auto__)(clause-with-extraction-named-params data__5542__auto__ v__5543__auto__)Lens for the named-params field from a ClauseWithExtraction record. See active.clojure.sum-type/make-clause-with-extraction.
Lens for the `named-params` field from a [[ClauseWithExtraction]] record. See [[active.clojure.sum-type/make-clause-with-extraction]].
(clause-with-extraction? thing)Is object a ClauseWithExtraction record? See active.clojure.sum-type/make-clause-with-extraction.
Is object a `ClauseWithExtraction` record? See [[active.clojure.sum-type/make-clause-with-extraction]].
(clause-with-predicate-body rec__2584__auto__)(clause-with-predicate-body data__2585__auto__ v__2586__auto__)(clause-with-predicate-body rec__5541__auto__)(clause-with-predicate-body data__5542__auto__ v__5543__auto__)Lens for the body field from a ClauseWithPredicate record. See active.clojure.sum-type/make-clause-with-predicate.
Lens for the `body` field from a [[ClauseWithPredicate]] record. See [[active.clojure.sum-type/make-clause-with-predicate]].
(clause-with-predicate-predicate rec__2584__auto__)(clause-with-predicate-predicate data__2585__auto__ v__2586__auto__)(clause-with-predicate-predicate rec__5541__auto__)(clause-with-predicate-predicate data__5542__auto__ v__5543__auto__)Lens for the predicate field from a ClauseWithPredicate record. See active.clojure.sum-type/make-clause-with-predicate.
Lens for the `predicate` field from a [[ClauseWithPredicate]] record. See [[active.clojure.sum-type/make-clause-with-predicate]].
(clause-with-predicate? thing)Is object a ClauseWithPredicate record? See active.clojure.sum-type/make-clause-with-predicate.
Is object a `ClauseWithPredicate` record? See [[active.clojure.sum-type/make-clause-with-predicate]].
(colorize pred tree)Colorizes a node if pred matches (that is, setting colored? to true
Colorizes a node if pred matches (that is, setting colored? to `true`
(default-clause-body rec__2584__auto__)(default-clause-body data__2585__auto__ v__2586__auto__)(default-clause-body rec__5541__auto__)(default-clause-body data__5542__auto__ v__5543__auto__)Lens for the body field from a DefaultClause record. See active.clojure.sum-type/make-default-clause.
Lens for the `body` field from a [[DefaultClause]] record. See [[active.clojure.sum-type/make-default-clause]].
(default-clause? thing)Is object a DefaultClause record? See active.clojure.sum-type/make-default-clause.
Is object a `DefaultClause` record? See [[active.clojure.sum-type/make-default-clause]].
(find-non-colored-leafs tree)Finds non-colored leafs by recursion. Stops descending if colored intermediate node occurs
Finds non-colored leafs by recursion. Stops descending if colored intermediate node occurs
(find-not-covered tree symbols)Finds all predicates in the type-tree that are not covered by symbols
Finds all predicates in the type-tree that are not covered by symbols
(make-clause-with-extraction constructor-symbol named-params body)Construct a ClauseWithExtraction record.
constructor-symbol: access via active.clojure.sum-type/clause-with-extraction-constructor-symbol
named-params: access via active.clojure.sum-type/clause-with-extraction-named-params
body: access via active.clojure.sum-type/clause-with-extraction-body
Construct a `ClauseWithExtraction` record. `constructor-symbol`: access via [[active.clojure.sum-type/clause-with-extraction-constructor-symbol]] `named-params`: access via [[active.clojure.sum-type/clause-with-extraction-named-params]] `body`: access via [[active.clojure.sum-type/clause-with-extraction-body]]
(make-clause-with-predicate predicate body)Construct a ClauseWithPredicate record.
predicate: access via active.clojure.sum-type/clause-with-predicate-predicate
body: access via active.clojure.sum-type/clause-with-predicate-body
Construct a `ClauseWithPredicate` record. `predicate`: access via [[active.clojure.sum-type/clause-with-predicate-predicate]] `body`: access via [[active.clojure.sum-type/clause-with-predicate-body]]
(make-default-clause body)Construct a DefaultClause record.
body: access via active.clojure.sum-type/default-clause-body
Construct a `DefaultClause` record. `body`: access via [[active.clojure.sum-type/default-clause-body]]
(match sum-type arg & clauses)Takes a sum-type, a argument and a list of clauses, and expands it to a cond form.
sum-type is a type identifier, as defined by define-sum-type.
arg is the argument to be matched upon.
clauses are pairs of conditions and bodies, e.g.:
(match rgb-color a red? "red" (make-green a) (str "Green with " a) blue? "blue")
There is also a default clause, denoted by the keyword :default as the condition.
This macro throws at compile time if (ordered):
sum-type is no symbolsum-type doesn't resolve to a sum-typesum-type.The resulting form throws at runtime if the passed argument is not of type sum-type
Takes a sum-type, a argument and a list of clauses, and expands it to a cond form.
`sum-type` is a type identifier, as defined by `define-sum-type`.
`arg` is the argument to be matched upon.
`clauses` are pairs of conditions and bodies, e.g.:
`(match rgb-color a
red? "red"
(make-green a) (str "Green with " a)
blue? "blue")
`
There is also a default clause, denoted by the keyword `:default` as the condition.
This macro throws at compile time if (ordered):
- `sum-type` is no symbol
- `sum-type` doesn't resolve to a sum-type
- an uneven number of clauses is passed
- conditions contain a non-related function, that is, not a predicate or constructor of
the passed sum-type in `sum-type`.
- The matching is not exhaustive, i.e. a particular predicate/constrcutor is missing.
The resulting form throws at runtime if the passed argument is not of type `sum-type`(throw-when-non-type-functions! tree fun-symbols t debug)Throws if fun-symbols contains functions that are neither a predicate nor a constructor in the type-tree
Throws if fun-symbols contains functions that are neither a predicate nor a constructor in the type-tree
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 |