bidict

Types

pub type Bidict(a, b) {
  Bidict(a2b: Dict(a, b), b2a: Dict(b, a))
}

Constructors

  • Bidict(a2b: Dict(a, b), b2a: Dict(b, a))

Functions

pub fn delete_a(bdict: Bidict(a, b), a: a) -> Bidict(a, b)
pub fn delete_b(bdict: Bidict(a, b), b: b) -> Bidict(a, b)
pub fn drop_a(
  bdict: Bidict(a, b),
  disallowed_a: List(a),
) -> Bidict(a, b)
pub fn drop_b(
  bdict: Bidict(a, b),
  disallowed_b: List(b),
) -> Bidict(a, b)
pub fn filter(
  in bdict: Bidict(a, b),
  keeping predicate: fn(a, b) -> Bool,
) -> Bidict(a, b)
pub fn fold(
  over bdict: Bidict(a, b),
  from initial: c,
  with fun: fn(c, a, b) -> c,
) -> c
pub fn from_list(list: List(#(a, b))) -> Bidict(a, b)
pub fn get_a(bdict: Bidict(a, b), a: a) -> Result(b, Nil)
pub fn get_b(bdict: Bidict(a, b), b: b) -> Result(a, Nil)
pub fn has_a(bdict: Bidict(a, b), a: a) -> Bool
pub fn has_b(bdict: Bidict(a, b), b: b) -> Bool
pub fn insert(bdict: Bidict(a, b), a: a, b: b) -> Bidict(a, b)
pub fn keys(bdict: Bidict(a, b)) -> List(a)
pub fn map(bdict: Bidict(a, b), fun: fn(a, b) -> c) -> List(c)
pub fn map_keys(
  bdict: Bidict(a, b),
  fun: fn(a, b) -> c,
) -> Bidict(c, b)
pub fn map_values(
  bdict: Bidict(a, b),
  fun: fn(a, b) -> c,
) -> Bidict(a, c)
pub fn merge(
  bdict: Bidict(a, b),
  new_bdict: Bidict(a, b),
) -> Bidict(a, b)
pub fn new() -> Bidict(a, b)
pub fn size(bdict: Bidict(a, b)) -> Int
pub fn take(
  from bdict: Bidict(a, b),
  keeping desired_keys: List(a),
) -> Bidict(a, b)
pub fn to_list(bdict: Bidict(a, b)) -> List(#(a, b))
pub fn update(
  bidict: Bidict(a, b),
  a: a,
  fun: fn(Option(b)) -> b,
) -> Bidict(a, b)
pub fn values(bdict: Bidict(a, b)) -> List(b)
Search Document