effectful 0.2.0

Effect<A, E, R> (sync + async), context/layers, pipe — interpreter-style, no bundled executor
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Ex 023 — `get_path` follows `ThereHere` / `Skip` paths.
use effectful::{ThereHere, Service, ctx};

#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Service)]
struct FirstKey;
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Service)]
struct SecondKey;

fn main() {
  let env = ctx!(FirstKey => 1_u8, SecondKey => 2_u16);
  assert_eq!(*env.get_path::<SecondKey, ThereHere>(), 2);
  println!("023_get_path ok");
}