Predicate
A predicate is a condition or relation over values or entities that specifies whether a stated property holds.
Clojure: The Essential Reference
A predicate is a function whose result is interpreted as a boolean condition, even when its returned value is not literally boolean.
- How it is used
- Uses predicates to select collection items, answer all-or-any questions, compose checks, and enforce function conditions.
- How deep it goes
- Defines the unary contract and truth-value interpretation, then details return values, short-circuiting, laziness, and assertion failures.
- Examples
- Demonstrates odd-number filtering, palindrome checks, email spam detection, prize lookup, and validation before and after saving an item.
- What you can do after
- Apply it via Clojure's filter, remove, every?, some, every-pred, and some-fn to select values and combine checks.
Read how Clojure: The Essential Reference explains predicate →
Kafka Streams in Action, Second Edition
Predicate is a boolean-valued functional interface that evaluates a record to determine whether it belongs in a branch.
- How it is used
- Routes Kafka Streams records through filters, branches, and data-driven aggregation decisions.
- How deep it goes
- Explains predicate use through filter and split APIs, then shows Processor API tests without detailing predicate internals.
- Examples
- Uses reward-qualifying purchases, coffee and electronics routing, and sensor-driven aggregation.
- What you can do after
- Apply it via Kafka Streams to retain, drop, route, or aggregate records by record-level conditions.
Read how Kafka Streams in Action, Second Edition explains predicate →
Learn SQL in a Month of Lunches
A predicate is a Boolean SQL expression that evaluates whether a condition holds for data involved in a query operation.
- How it is used
- Uses predicates to join related tables, filter query results, and limit multitable updates.
- How deep it goes
- Defines true, false, and unknown evaluation, then demonstrates join, filter, and multitable-update predicate placement without formal evaluation internals.
- Examples
- Demonstrates matching orderheader to customer for order 1001 and changing prices of titles linked to AuthorID 12.
- What you can do after
- Apply predicates to match table rows, restrict results, and recognize product-specific multitable UPDATE syntax.
Read how Learn SQL in a Month of Lunches explains predicate →
Kotlin in Action, 2E
A predicate function is a function that evaluates an input and returns a Boolean indicating whether it satisfies a condition.
- How it is used
- Uses Boolean-returning functions to query, filter, and validate elements in collections and sequences.
- How deep it goes
- Explains predicate syntax, collection behavior, higher-order implementation, negation choices, and empty-collection edge cases.
- Examples
- Demonstrates age checks, collection queries, character filtering, empty collections, and configurable contact-list filtering.
- What you can do after
- Apply predicates via Kotlin collection functions and implement higher-order functions that accept or return filtering logic.
100 C++ Mistakes and How to Avoid Them
A predicate is a Boolean-valued function that determines whether a value satisfies a condition.
- How it is used
- Uses predicates to decide which values survive range filtering and to illustrate concise Boolean-returning functions.
- How deep it goes
- Defines Boolean results and shows filtering and direct-return examples, without developing predicate internals.
- Examples
- Uses an even-number test and an absolute-value, filter, and sum pipeline.
- What you can do after
- Apply predicates via std::views::filter to retain matching values, and return computed Boolean expressions directly.
Read how 100 C++ Mistakes and How to Avoid Them explains predicate →
Also covered in
- Effective Platform Engineering
- Learn C++ by Example
- Data Analysis with LLMs
- Python Concurrency with asyncio
- Type-Driven Development with Idris
- F# in Action: A Revised Edition of Get Programming with F#
- Grokking Simplicity
- Advanced Algorithms and Data Structures
- Learn Haskell by Example
- 100 Java Mistakes and How to Avoid Them
- Essential TypeScript 5, Third Edition
- PostgreSQL Mistakes and How to Avoid Them
What to know first
- lambdaA lambda is an expression that defines an unnamed function, specifying its parameters and body and producing a callable value.
- MapA map is an associative data structure that stores key-value associations and supports retrieving values by key.
- SQLSQL is a standardized declarative language for defining, querying, and manipulating data in relational database systems.
- booleanA Boolean is a logical value or data type representing truth or falsity, conventionally with the two values true and false.
Related concepts
- filteringused by · Filtering is the selection or exclusion of data or items according to specified criteria.
- functionkind of · A function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- booleanproduces · A Boolean is a logical value or data type representing truth or falsity, conventionally with the two values true and false.
- BranchedKStream.branchused by · BranchedKStream.branch is a Kafka Streams method that creates a branch by applying a predicate and branch-processing definition to records.
- KStream.splitused by · KStream.split is a Kafka Streams DSL method that begins branching a KStream and returns a BranchedKStream.
Questions about predicate
What is predicate?
A predicate is a condition or relation over values or entities that specifies whether a stated property holds.
Which Manning books explain predicate?
Clojure: The Essential Reference, Kafka Streams in Action, Second Edition, Learn SQL in a Month of Lunches, Kotlin in Action, 2E and 100 C++ Mistakes and How to Avoid Them.
What should I know before learning predicate?
Manning books that teach predicate usually introduce lambda, Map, SQL and boolean first.
What kinds of predicate are there?
Kinds of predicate include Elem.
What is predicate a kind of?
Predicate is a kind of function. A function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




