id_effect 0.4.0

Effect<A, E, R> (sync + async), capability DI, pipe — interpreter-style, no bundled executor
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Bifold an Either.

use id_effect::algebra::bifoldable::either::bifold;
use id_effect::foundation::coproduct::{left, right};

fn main() {
  let l = bifold(
    left::<String, i32>(1),
    |x| format!("L{x}"),
    |x| format!("R{x}"),
  );
  let r = bifold(
    right::<String, i32>("ok".into()),
    |x| format!("L{x}"),
    |x| format!("R{x}"),
  );
  println!("{l} / {r}");
}