effs 0.1.0

Effects based minimal std lib alternative
Documentation
  • Coverage
  • 100%
    1 out of 1 items documented0 out of 0 items with examples
  • Size
  • Source code size: 2.64 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 228.57 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • swarnimarun

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.