Posts

๐Ÿ“ฆ v0.0.0-dev.1 — Search & AsyncSearch

๐Ÿ“ฆ v0.0.0-dev.1 —   Search   &   AsyncSearch We’re thrilled to announce the   first prerelease   of   @fizzwiz/search :   v0.0.0-dev.1   — a library dedicated to   declarative, lazy search abstractions   for computational spaces. Core Features in this Release Search   — synchronous, lazy search for combinatorial or infinite spaces AsyncSearch   — asynchronous, parallelized search for distributed or concurrent workloads Fully lazy, fluent, and extensible API Compatible with any queue strategy (FIFO, DFS, priority queues, custom) ๐Ÿงช This is a   prerelease . Your feedback is essential for shaping the API’s evolution and the next features of   @fizzwiz/search . “Explore freely. Push limits. Capture the wonder of computation.” —   @fizzwiz ✨

๐Ÿงฎ Exploring Combinatoric Calculus

๐Ÿงฎ Exploring Combinatoric Calculus with   Search The   Search   abstraction in   @fizzwiz/search   provides a clean, declarative way to generate and explore   combinatorial structures . You simply   describe   how candidates expand — and let the lazy search engine handle the traversal. ๐Ÿง  Concept: Combinatorics as Exploration Most combinatorial problems can be understood as a   space of possible choices : Dispositions   → sequences of fixed length Combinations   → subsets of fixed length Power sets   → all subsets Traditionally, each one requires its own custom algorithm — often recursive, imperative, and hard to generalize. With   Search , you model them all with a single idea: Start from an initial candidate, and expand it into new candidates using a declarative rule. ⚙️ Defining a Search Process Each search consists of three parts: Start   – The initial candidate (e.g., an empty path). Space   – A function des...

⚡ Early vs. Late Restriction

⚡ Early vs. Late Restriction in Combinatorial Search One of the core design strengths of   @fizzwiz/fluent   — and by extension   @fizzwiz/search   — is the ability to optimize   combinatorial search   via   early restriction   of the search space. This distinction may look subtle, but its impact on performance can be dramatic. ๐Ÿšง The Problem Imagine generating all sorted paths of length   3   from the items   [0, 1] ,   with repetitions . A naive approach would: Generate   all possible paths   of length 3 Filter out the unsorted ones This works — but performs far more work than necessary. With   @fizzwiz/fluent , you can   reject invalid paths immediately ,   before   their descendants are ever constructed. ⚙️ Early vs. Late Restriction Side-by-side comparison: const // Returns a `What` of paths without eagerly building arrays space = Each . each ([ 0 , 1 ], [ 0 , 1 ], [ 0 , 1 ]), // Pred...

๐Ÿง  The Search-and-Select Pattern

๐Ÿง  The Search-and-Select Pattern ๐Ÿ” Multivalued Functions as Possibility A function that returns   iterables   instead of a single value can be understood in two powerful ways: Uncertainty: The function doesn’t know the answer yet, so it returns several plausible options. Exploration: When input and output share the same type, the function becomes a   map : from one point, it shows all the directions you can go next. That second interpretation unlocks something fundamental: A multivalued function   is   a search space. ๐Ÿงญ Step by Step Toward a Solution Think about how you actually solve hard problems. You don’t jump straight to the solution. You: make a rough guess, explore variations, discard bad paths, and gradually converge on something that works. The Search class models exactly this process. Each step looks like: Pull the most promising candidate from a queue Push all neighboring possibilities back into the queue Prune the least promising candidates if th...