RepositoryRust
TeaEntityLab

TeaEntityLab/fpRust

Monad/MonadIO, Handler, Coroutine/doNotation, Functional Programming features for Rust

125stars
7forks
0issues
0views

🦀 fpRust: Mang phong cách lập trình hàm và reactive vào Rust

Thư viện cung cấp Monad, MonadIO, Publisher, Coroutine, Actor và DoNotation cho Rust, lấy cảm hứng từ Haskell, Rx và lập trình bất đồng bộ.

fpRust là một thư viện Rust mở nguồn, xây dựng để mang các khái niệm lập trình hàm sâu như Monad, MonadIO, Coroutine, Actor và DoNotation vào ngôn ngữ Rust — nơi mà những tính năng này thường khó triển khai. Dự án lấy cảm hứng từ lập trình hàm (Haskell), lập trình reactive (Rx) và các mô hình bất đồng bộ phổ biến trong Java/Android.

✨ Điểm nổi bật

  • MonadIO: Hỗ trợ map, fmap, subscribe, đồng bộ và bất đồng bộ, tích hợp Future qua feature: for_futures.
  • Publisher: Mô hình PubSub với hỗ trợ Stream thông qua subscribe_as_stream() và feature: for_futures.
  • Hàm FP: Cung cấp macro compose!, pipe!, map!, reduce!, filter!, foldl!, foldr!, contains!, reverse!.
  • Bất đồng bộ: Bao gồm BlockingQueue, HandlerThread (lấy cảm hứng từ Android Handler), WillAsync và CountDownLatch.
  • Coroutine (Cor): Hỗ trợ generator giống Python, yield/yieldFrom, đồng bộ và bất đồng bộ.
  • Actor: Mô hình Actor đơn giản với receive/send/spawn, hỗ trợ trạng thái nội bộ và giao tiếp giữa các Actor.
  • DoNotation: Macro kiểu Haskell DoNotation dựa trên Coroutine.

💡 Vì sao đáng chú ý

fpRust khá khác biệt so với các thư viện Rust khác ở chỗ tích hợp đồng thời nhiều khái niệm lập trình hàm phức tạp trong một crate duy nhất — từ Monad đến Actor và Coroutine. Điều này giúp người dùng dễ dàng áp dụng các mô hình reactive và bất đồng bộ mà không cần phụ thuộc vào nhiều thư viện rời nhau. Thích hợp cho dự án cần xử lý luồng dữ liệu phức tạp, xây dựng pipeline bất đồng bộ hoặc triển khai kiến trúc Actor trong Rust.


#Rust #FunctionalProgramming #ReactiveProgramming #Monad #Coroutine #ActorModel #TiniX

Similar Projects

Discover other similar projects and AI models.

RepositoryKotlin
Ivy-Apps/ivy-wallet

Ivy Wallet is an open-source money manager app for Android, no longer maintained. You can fork the code or download the final version from Google Play.

3.2k
Oct 22, 2026
Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
190.2M
Jun 1, 2026
RepositoryRust
farion1231/cc-switch

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

148.9k
Oct 26, 2026
RepositoryJavaScript
MostlyAdequate/mostly-adequate-guide

Mostly adequate guide to FP (in javascript)

23.8k
Sep 17, 2024
RepositorySwift
kickstarter/ios-oss

Kickstarter for iOS. Bring new ideas to life, anywhere.

8.7k
Oct 15, 2026
RepositoryC#
reactiveui/ReactiveUI

A composable, cross-platform MVVM framework for .NET inspired by functional reactive programming. It moves mutable state out of the user interface, keeps each feature's logic in one readable place, and makes applications easier to test. Supports WPF, WinForms, WinUI, .NET MAUI, Avalonia, Uno Platform, Blazor and Android.

8.5k
Oct 18, 2026
RepositoryJava
kaushikgopal/RxJava-Android-Samples

Learning RxJava for Android by example

7.5k
Aug 8, 2023
RepositoryC#
louthy/language-ext

C# pure functional programming framework - come and get declarative!

7.1k
Oct 9, 2026
RepositoryKotlin
arrow-kt/arrow

The perfect companion for your Kotlin journey - Inspired by functional, data-oriented and concurrent programming

6.6k
Oct 23, 2026