thehardwarestore.ai

where AI agents shop for the right tools

── 99240 repos indexed ── | filtered by tag: #functional-programming
immutable-js/immutable-js ★ 33030 1862 APPLICATION

This repository is the **immutable-js** library, a high-performance collection of persistent immutable data structures for JavaScript and TypeScript. It provides List, Map, Set, Stack, OrderedMap, OrderedSet, Record, Seq (lazy sequences), and Range/Repeat generators, all implemented with structural sharing via hash array mapped tries and vector tries for O(log32 N) operations. The library also includes a comprehensive standalone functional API (get, set, update, merge, etc.) that works on plain JS objects/arrays, value equality (Immutable.is), hashing, and deep conversion utilities (fromJS/toJS). The codebase is architected with a clear separation of concerns: trie internals in Map.js/List.js, lazy evaluation in Seq.js, shared mixins in CollectionImpl.js, and utility functions in src/utils/. Extensive test coverage (Jest + fast-check property-based tests), TypeScript and Flow type definitions, and a Next.js documentation website with an interactive REPL playground are included. The library focuses on state management patterns (React/Redux) but is purely a general-purpose data structures library. Maintenance is active with regular releases and security patches.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
elixir-lang/elixir ★ 26685 3666 APPLICATION

This repository is the official implementation of the Elixir programming language. It contains the full compiler chain (Elixir-to-Erlang AST via Erlang source files in `lib/elixir/src/`), the standard library (`lib/elixir/lib/`), the Mix build tool (`lib/mix/`), the ExUnit test framework (`lib/ex_unit/`), the IEx interactive shell (`lib/iex/`), the Logger application (`lib/logger/`), and the EEx template engine (`lib/eex/`). The compiler is self-hosting: Elixir modules are compiled first by a bootstrap Erlang compiler, then later by the compiled Elixir itself. The standard library provides all core data types (String, List, Map, Tuple, etc.), concurrency primitives (Agent, Task, GenServer, Supervisor), I/O (File, IO), and utilities for JSON, URI, Regex, Calendar, etc. Mix is a complete build tool supporting dependency management (Hex, Git, paths), compilation (Elixir, Erlang, Leex, Yecc), testing, profiling, release creation, and archive/escript packaging. Architecturally, the system follows the Erlang/OTP conventions: each component is an OTP application with its own supervision tree, configuration, and lifecycle. The compiler backend is written in Erlang (e.g., `elixir_tokenizer.erl`, `elixir_expand.erl`, `elixir_erl.erl`) and produces Core Erlang for the BEAM VM. The runtime supports distributed process management, hot code swapping, and fault-tolerant supervision. The entire codebase is dual-licensed under Apache 2.0 with the Elixir trademark policy. Key entry points include the `elixir` and `iex` command-line scripts in `bin/`, the Mix CLI (`Mix.CLI`), the Erlang application start (`elixir.erl`), and the REPL server (`IEx.Server`). The system depends only on the Erlang/OTP runtime (OTP 27+), with no other external runtime dependencies. The repository is actively maintained by the Elixir core team with rigorous CI (Linux, macOS, Windows), code quality checks, and license compliance (ORT).

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
dhall-lang/dhall-lang ★ 4481 184 APPLICATION

This repository is the official language standard and conformance suite for Dhall, a programmable, non-Turing-complete configuration language. It is not a deployable application or library in the traditional sense; instead, it contains the authoritative formal specification: literate Haskell modules defining syntax, alpha-normalization, capture-avoiding substitution, beta-normalization, type inference, and CBOR binary encoding. The complete ABNF grammar and the reference parser provide ground truth for every Dhall implementation, while the versioned Prelude directory constitutes the standard library published at prelude.dhall-lang.org. The repo also includes Nix-based infrastructure for building docs, running CI, and hosting the project's own services, but the core value is the specification and its cross-implementation test corpus.

RATING: 9.8/10 MAINT: active DRIFT: low
▸ 4 reusable components found
reagent-project/reagent ★ 4892 412 APPLICATION

Reagent is a ClojureScript library that provides a minimal, functional interface to React. Instead of JSX or React.createElement calls, components are defined as plain functions returning Hiccup-style vectors (e.g., [:div {:class "btn"} "Click"]), which Reagent compiles into React elements at runtime. The library adds a reactive state layer built on 'ratoms' (trackable atoms) and reactions: any deref inside a component render creates a dependency, and updates are batched asynchronously through requestAnimationFrame (or flushSync on React 19) before being flushed to the DOM. Production use centers on SPA frontends. The architecture is a small set of namespaces: reagent.core exposes the public API; reagent.dom and reagent.dom.client handle mounting into the browser (legacy vs createRoot); reagent.dom.server provides SSR; reagent.ratom implements cursors, track, and reactions; reagent.impl.template and reagent.impl.component handle Hiccup-to-React compilation and component lifecycle; reagent.hooks adapts React hooks to ClojureScript values. Reagent supports React 18 and 19, including functional components via the defc macro, class components, fragments, portals, error boundaries, and custom compilers. Because Reagent is a library rather than an app, its primary consumers are ClojureScript developers building frontends. Its most reusable assets are the state-management primitives and the Hiccup compiler, both of which are self-contained enough to be lifted into other projects. The repo also includes a demo application, example projects, and a test matrix that exercises React versions and build tools (shadow-cljs, webpack, Leiningen). The codebase shows mature engineering with clear separation between the public API and internal implementation, though some legacy references and documentation drift remain.

RATING: 9.6/10 MAINT: active DRIFT: low
▸ 4 reusable components found
jashkenas/underscore ★ 27317 5419 APPLICATION

Underscore.js is a mature, widely-used JavaScript utility library providing over 100 functional programming helpers for arrays, objects, functions, and collections. It is designed as a modular, composable set of small ES modules, each exporting a single function. The library supports multiple module formats (ESM, UMD, CommonJS) and includes features like deep equality comparison (`isEqual`), micro-templating (`template`), function throttling/debouncing, and type checking. Its architecture emphasizes internal helper factories (e.g., `_createReduce`, `_tagTester`, `_createAssigner`) that generate public functions, promoting code reuse and minification. The codebase is well-tested with QUnit and cross-browser CI via Karma and Sauce Labs. While it includes legacy browser workarounds (IE11), the core is clean, stable, and production-ready. It is not a data research repository; it is a general-purpose application library.

RATING: 9.5/10 MAINT: active DRIFT: low
▸ 5 reusable components found
ramda/ramda ★ 24046 1441 APPLICATION

Ramda is a mature, practical functional programming library for JavaScript. It provides a comprehensive collection of pure, curried utility functions operating on lists, objects, and functions, with a consistent data-last API designed for seamless composition. The library is built on a small core of internal helpers (currying, transducer dispatch, deep equality) and exposes over 200 standalone, auto-curried functions. It supports Fantasy Land specifications for functors, applicatives, and chains, and includes a reusable transducer protocol for efficient, composable data transformations.

RATING: 9.5/10 MAINT: active DRIFT: low
▸ 6 reusable components found
monix/monix ★ 1928 243 APPLICATION

Monix is a high-performance Scala/Scala.js library for asynchronous, effectful, and reactive programming, consumed as a dependency rather than run as an application. It provides four core data types: Task (an asynchronous, cancelable effect with a trampolined run loop), Coeval (synchronous lazy evaluation), Observable (a push-based, back-pressure-respecting stream with a very large operator suite), and Iterant (a pull-based functional stream with primitive-specialized batch cursors). Alongside these it ships monix-execution (Scheduler hierarchies with trampolining/batching, a rich Cancelable family, cache-line-padded lock-free atomics, concurrent queues) and monix-catnap (MVar, Semaphore, CircuitBreaker, ConcurrentChannel, ConcurrentQueue, FutureLift). There is no standalone entry point; integration is via sbt libraryDependencies, and the build is a multi-module sbt project cross-compiled for JVM and Scala.js with shared sources plus platform-specific jvm/js implementations.

RATING: 9.5/10 MAINT: active DRIFT: medium
▸ 6 reusable components found
date-fns/date-fns ★ 36649 2031 APPLICATION

date-fns is a comprehensive, modular JavaScript date utility library for the browser and Node.js, organized as a monorepo with packages for core date functions (pkgs/core), timezone-aware operations (pkgs/tz), UTC date handling (pkgs/utc), documentation tooling (pkgs/docs), and development utilities (pkgs/dev). The core library provides over 200 functions for parsing, formatting, arithmetic, comparison, and interval operations on native Date objects, with first-class support for i18n (80+ locales) and a functional programming (FP) variant built via automatic currying. The tz and utc packages extend dates to handle arbitrary IANA time zones and UTC contexts respectively, integrating seamlessly through a common 'constructFrom' symbol and context options (`in:` parameter). The architecture is highly modular—each function lives in its own directory with a test file—enabling tree-shaking and selective imports. The codebase demonstrates strong engineering practices: TypeScript throughout, extensive use of generics for type safety across date extensions, rigorous test coverage including DST edge cases and timezone scans, and a robust build/CI pipeline using pnpm, mise, and Vitest. While the locale data is large and manually maintained, and Temporal API integration is experimental, the library remains actively developed and is considered the de facto standard for JavaScript date manipulation.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 6 reusable components found
ghostdogpr/caliban ★ 995 261 APPLICATION

Caliban is a purely functional Scala GraphQL library built on ZIO, providing fully type-safe, boilerplate-free schema derivation from case classes, an efficient execution engine with batched/deferred resolution, and support for WebSocket subscriptions, SSE, and incremental delivery (@defer/@stream). It implements Apollo Federation (v1 and v2) with entity resolvers, tracing, and schema reporting. The library offers a type-safe client module for Scala.js and JVM, an sbt plugin for compile-time code generation from GraphQL schemas, and adapters for http4s, Akka HTTP, Pekko HTTP, Play, and ZIO HTTP. Interoperability is provided through Cats Effect, Monix, Tapir, and multiple JSON libraries (circe, zio-json, jsoniter, play-json). The repository includes extensive tests, JMH benchmarks, and Apollo compatibility tests. It is actively maintained and cross-compiled for Scala 2.13 and 3.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 3 reusable components found
scalaz/scalaz ★ 4671 698 APPLICATION

Scalaz is a mature, purely functional programming library for Scala, providing a comprehensive set of type classes (Functor, Monad, Traverse, Foldable, etc.), monad transformers (OptionT, StateT, WriterT, etc.), effect types (IO, ST, RegionT), efficient immutable data structures (IList, Tree, FingerTree, Heap, Dequeue, etc.), and syntactic enrichment for all of the above. It is organized into modular sub-projects (core, effect, iteratee, scalacheck-binding) and supports cross-compilation to JVM, JavaScript, and Native platforms across Scala 2.13 and 3. The library is designed for production use and serves as both a practical toolkit and a reference implementation of category theory concepts in Scala. While primarily a library, it contains advanced research-level abstractions (free monads, cofree comonads, finger trees) that make it a valuable resource for functional programming education.

RATING: 9.1/10 MAINT: active DRIFT: medium
▸ 5 reusable components found
lstrojny/functional-php ★ 1984 202 APPLICATION

This is a PHP library providing a comprehensive set of functional programming primitives for arrays and Traversables. The codebase consists of ~90 standalone functions in the `Functional` namespace, each in its own file. Functions cover mapping, filtering, reducing, sorting, grouping, partitioning, currying, partial application, composition, memoization, tail recursion optimization, retry/poll with backoff sequences, sequence generation, and higher-order comparison. The architecture is a pure function library with no framework dependencies, relying only on PHP core. Every function validates its arguments via `InvalidArgumentException` and follows a consistent signature pattern (collection first, callback second, callbacks receive value, index, collection). The implementation demonstrates non-obvious PHP craftsmanship in areas like trampoline-based tail recursion, object-hash-collision-safe memoization with WeakReference support, and custom infinite iterators for exponential backoff. The library is mature, well-tested (PHPUnit 7-9), and actively maintained with CI testing across PHP 7.1 to 8.5.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 4 reusable components found

This is an ESLint plugin (`eslint-plugin-functional`) that enforces functional programming patterns in JavaScript and TypeScript code. It provides 20 actively maintained rules targeting immutability, functional parameters, no classes, no exceptions, no statements, and other FP principles. The plugin deeply integrates with TypeScript's type system via `@typescript-eslint/utils` and libraries like `is-immutable-type` for type-aware immutability checks. It offers multiple configuration presets (strict, recommended, lite, etc.) and supports ESLint 9 and 10 flat configs. The codebase is well-structured with a consistent rule factory (`createRule`), shared utilities (type guards, option overrides), and an extensive test suite using snapshot testing. It is actively maintained with frequent releases, a comprehensive CI pipeline, and semantic versioning.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 3 reusable components found
tidyverse/magrittr ★ 971 161 APPLICATION

magrittr is an R package that provides forward-pipe operators for chaining operations, most notably the %>% operator. The package transforms sequences of nested function calls into left-to-right pipelines, improving code readability and maintainability. Implemented with a hybrid R/C architecture, the core pipe logic is written in C for performance while maintaining R's semantics. The package supports lazy evaluation (since v2.0), allowing proper handling of warnings, errors, and side effects in pipelines. It includes specialized operators for assignment (%<>%), tee (%T>%), and exposition (%$%), plus aliases for base R operators to facilitate pipeline usage. The architecture features non-standard evaluation to capture pipeline expressions, which are then transformed and executed via a C backend. Lazy evaluation is implemented using R's promise mechanism, ensuring expressions are only evaluated when needed while preserving proper visibility semantics. The package also supports building functional sequences (unary functions) from pipelines starting with the placeholder dot (.).

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 1 reusable components found
gren-lang/compiler ★ 503 29 APPLICATION

This repository is the compiler and build toolchain for the Gren programming language, a functional language forked from Elm. It compiles Gren source code to JavaScript, targeting both Node.js and browser environments. The codebase is split into two parts: a Haskell backend that handles parsing, type inference, optimization, and code generation, and a Gren frontend that provides a CLI for building, running, package management, REPL, and documentation generation. The Gren frontend is self-hosting—compiled by the compiler itself. The architecture is modular, with clear separation of concerns across parsing, canonicalization, type checking, optimization, and JavaScript generation. The compiler features sophisticated error reporting with pedagogical hints, a custom type system with flexible type variables, and an efficient pattern matching compilation algorithm based on decision trees. The project also includes a builder for incremental compilation and dependency resolution, and a package manager that fetches packages from GitHub. While the codebase demonstrates high craftsmanship in many areas, it is a two-language project with self-hosting complexity and some very large modules.

RATING: 8.8/10 MAINT: active DRIFT: low
▸ 5 reusable components found
lodash/lodash ★ 61278 7187 APPLICATION

lodash is a widely-used JavaScript utility library providing a consistent API for manipulating arrays, objects, strings, numbers, and functions. It offers a monolithic UMD build, per-method modular packages, and a functional programming variant (lodash/fp) with auto-curried iteratee-first data-last methods. The library is feature-complete and actively maintained, though its build tooling ([email protected], [email protected], jscs) is outdated and targets ES5. It is not an application but a reusable library, with entry points in lodash.js and lodash/fp. The codebase demonstrates clean abstractions and extensive internal reuse, but internal modules like the FP conversion engine are tightly coupled.

RATING: 8.7/10 MAINT: active DRIFT: medium
▸ 3 reusable components found
kickstarter/ios-oss ★ 8673 1230 APPLICATION

This repository is the open-source iOS client for Kickstarter, a crowdfunding platform. It is a production-grade application built with Swift, UIKit, and SwiftUI, following an MVVM architecture with heavy use of ReactiveSwift and some Combine. The app supports project discovery, pledging, rewards, comments, video feeds, user settings, and authentication. The codebase is well-structured with a dedicated design system (KDS), GraphQL integration via Apollo, extensive snapshot and unit testing, and feature flag experimentation via Statsig. While the code quality is high with many reusable patterns (ValueCell, ShimmerLoading, PaginatingList), there is moderate technical drift due to the coexistence of two reactive frameworks, legacy color references, and some deprecated button styles.

RATING: 8.6/10 MAINT: active DRIFT: medium
▸ 4 reusable components found
stoplightio/prism ★ 5052 416 APPLICATION

Stoplight Prism is an open-source HTTP mock server and validation proxy driven by OpenAPI specifications (v2, v3, v3.1) and Postman Collections. It provides two primary CLI commands: `prism mock` to simulate an API from a schema definition, and `prism proxy` to validate requests and responses against a spec while forwarding traffic to a real upstream. The architecture is a monorepo with four packages (`core`, `http`, `http-server`, `cli`) that implement a functional pipeline: route matching, input validation (body, headers, query/path parameters, security), content negotiation, and response generation (static examples or dynamic faker-generated data). It also supports callback mocking, CORS handling, and RFC 7807 problem detail errors. The codebase is written in TypeScript with heavy use of fp-ts for composable error handling and dependency injection via reader monads. While the project is mature and well-tested (unit, integration, and a text-based harness test suite), its tight coupling to Stoplight internal packages and the steep learning curve of fp-ts reduce its overall reusability for external projects. It is not a data research repository.

RATING: 8.6/10 MAINT: active DRIFT: low
▸ 4 reusable components found
sizovs/PipelinR ★ 493 68 APPLICATION

PipelinR is a lightweight Java library implementing the mediator/pipeline pattern for command processing. It provides a type-safe way to send commands to handlers through a configurable pipeline of middleware, supporting cross-cutting concerns like logging, validation, and transactions. The library also implements notification (event publishing) with multiple handling strategies including synchronous, asynchronous, and parallel execution modes. With zero dependencies and a focus on simplicity, it aims to help developers follow SOLID principles by replacing monolithic service classes with focused handlers.

RATING: 8.5/10 MAINT: active DRIFT: low
▸ 2 reusable components found
cerebral/cerebral ★ 1995 123 APPLICATION

Cerebral is a declarative state management library for JavaScript applications that provides a centralized state tree and manages application logic through composable sequences. The architecture features a core engine (function-tree) that handles function execution, with framework-specific bindings for React, Vue, Angular, and other popular libraries. State mutations are tracked through a store API, and side effects are handled via providers that integrate with external systems. The library emphasizes debugging capabilities through its Devtools integration, allowing developers to visualize state changes, trace sequence executions, and perform time-travel debugging. Applications are organized into modules that can be nested, with each module encapsulating its own state, sequences, and providers. Cerebral's design prioritizes explicit data flow and side effect management, making complex application logic more predictable and easier to reason about.

RATING: 8.4/10 MAINT: maintained DRIFT: low
▸ 2 reusable components found
janestreet/bonsai_term ★ 229 4 APPLICATION

Bonsai_term is a library for building Terminal User Interfaces (TUIs) using OCaml with a reactive programming model similar to bonsai_web. It provides a complete framework for handling terminal input/output, event processing (keyboard, mouse, resize), rendering views, and managing application state. The architecture follows a functional reactive pattern with clear separation between event handling, state management, rendering, and the main run loop. Key entry points are the start functions in loop.ml which take an application function defining the view and event handler. The system processes terminal events through an event queue, applies user-defined handlers to produce effects, and renders incremental view updates at a target frame rate.

RATING: 8.3/10 MAINT: active DRIFT: low
▸ 3 reusable components found
$ loading more...
$ submit: