effs

Crates.ioeffs
lib.rseffs
version0.1.0
created_at2025-11-03 10:29:10.529074+00
updated_at2025-11-03 10:29:10.529074+00
descriptionEffects based minimal std lib alternative
homepage
repository
max_upload_size
id1914413
size2,645
Swarnim Arun (swarnimarun)

documentation

README

super verbose experimental effect primitives

Rust effect inspired standard library like primitives. (very experimental avoid using in prod)

Effects are some reasonable constraint bound on a system that's managed via a control layer

NOTE: uses nightly rust please be mindful.

Goals

  1. Write a very verbose but sane effects like very minimal standard library alternative.
  2. Design better abstractions and context patterns around it with existing trait system features, and write some discovery on how to improve it further with new features.
  3. If successful use it for one of my larger projects or deploy at a large company.

Usage

  1. SimpleIoEff (TODO, not implemented yet!)
#![feature(impl_trait_in_assoc_type)]
use effs::prelude::*;

fn main() -> Result<()> {
/** TODO: add macros??
  effed!{
    with(Stdout) {
      Print("hello, world")
    }
  }}
**/
  effed(Print(Stdout))("hello, world")
}

struct Print<Io: SimpleIoEff>(Io);
impl<Io: SimpleIoEff> Effed for Print<Io> {
  type Input = impl AsRef<str>;
  type Output = ();
  fn run(self, input: Self::Input) -> Self::Output {
    let Self(io) = self;
    io.write(input.as_bytes());
  }
}

Motivation

Figuring out patterns of design for weird ideas I have. And testing various use cases.

Commit count: 0

cargo fmt