Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Recipes & Ideas

This chapter collects smaller ideas enabled by hooq.

Practical usage has already been shown in the Tutorial. These entries may be less practical but explore possibilities and might inspire new use cases.

Contents

PageSummary
Perfect color-eyreUse color-eyre for BACKTRACE/SPANTRACE, while also getting hooq’s pseudo trace for maximum insight.
Batch apply under a modulehooq can be attached to items like mod to hook inner functions recursively.
Using in functions returning OptionAdjust tail_expr_idents and result_types to target Option returns.
Turn ? into .unwrap() behind a featureUse #[cfg_attr(...)] to change behavior conditionally.
Reinvent match desugaringReplace ? with match using consume-question + custom flavor.