A collection of predicates and predicate helpers.
A collection of predicates and predicate helpers.
(->>assert pred v)
(->>assert pred error v)
(λ ((λ T) → Bool) → T) → T (λ ((λ T) → Bool) → T → String) → T
Function of a predicate, optionally a string and a value. If the predicate is not true of the value, this function will assert false giving the optional string or "->assert failed!" as the failure message. Otherwise returns the argument value.
Example: (->> 1 inc inc dec (->>assert number? "oh god the types"))
(λ ((λ T) → Bool) → T) → T (λ ((λ T) → Bool) → T → String) → T Function of a predicate, optionally a string and a value. If the predicate is not true of the value, this function will assert false giving the optional string or "->assert failed!" as the failure message. Otherwise returns the argument value. Example: (->> 1 inc inc dec (->>assert number? "oh god the types"))
(->assert v pred)
(->assert v pred error)
(λ T → ((λ T) → Bool)) → T (λ T → ((λ T) → Bool) → String) → T
Function of a value, a predicate and optionally a string. If the predicate is not true of the value, this function will assert false giving the optional string or "->assert failed!" as the failure message. Otherwise returns the argument value.
Example: (-> 1 inc inc dec (->assert number? "oh god the types"))
(λ T → ((λ T) → Bool)) → T (λ T → ((λ T) → Bool) → String) → T Function of a value, a predicate and optionally a string. If the predicate is not true of the value, this function will assert false giving the optional string or "->assert failed!" as the failure message. Otherwise returns the argument value. Example: (-> 1 inc inc dec (->assert number? "oh god the types"))
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close