rusty-hkt
A lightweight, no_std compatible library for emulating higher-kinded types in Rust.
Overview
rusty-hkt provides traits and implementations that enable functional programming patterns requiring higher-kinded types, which are not natively supported in Rust's type system.
The library uses a trait-based approach to emulate higher-kinded types, allowing you to write generic code over type constructors such as Option, Result, Vec, and others.
Features
- No standard library requirement: Works in
no_stdenvironments - Functional abstractions: Includes
Functor,Applicative, andMonadtraits - Built-in implementations for common Rust types:
OptionResultVec(requires theallocfeature)Box(requires theallocfeature)Identity(a simple wrapper type)
- Zero dependencies beyond the Rust core library
Usage
Add this to your Cargo.toml:
[]
= "0.1.0"
Basic Example
use ;
Working with Generic Type Constructors
use ;
// A function that works with any Functor
// Can be used with Option, Result, Vec, etc.
License
Licensed under the Apache License, Version 2.0. See the LICENSE file for more info.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Contact
- GitHub: voltageddebunked
- Email: rusindanilo@gmail.com