← all modules

Sky.Core.Dict

Sky.Core.Dict
  Sky.Core.Dict — associative map, ordered by key (Layer 3 Sky source).

Values
  empty : Dict k v
      The empty dictionary.
  foldl : (k -> v -> a -> a) -> a -> Dict k v -> a
      `foldl fn acc d` — accumulate over every entry, in ascending key
  fromList : List ( k, v ) -> Dict k v
      `fromList pairs` — build a dictionary from a list of tuples.
  get : k -> Dict k v -> Maybe v
      `get k d` — look up `k`; `Nothing` if absent.
  insert : k -> v -> Dict k v -> Dict k v
      `insert k v d` — bind `k → v`, replacing any prior value.
  isEmpty : Dict k v -> Bool
      `True` when the dictionary contains no entries.
  keys : Dict k v -> List k
      All keys in the dictionary, in ascending key order.
  map : (k -> v -> w) -> Dict k v -> Dict k w
      `map fn d` — apply `fn k v` to every entry, building a new
  member : k -> Dict k v -> Bool
      `member k d` — `True` iff `k` is bound in `d`.
  remove : k -> Dict k v -> Dict k v
      `remove k d` — drop `k`'s binding; no-op if absent.
  size : Dict k v -> Int
      Number of key/value pairs.
  toList : Dict k v -> List ( k, v )
      `toList d` — every (key, value) pair as a list of tuples, in
  union : Dict k v -> Dict k v -> Dict k v
      `union a b` — merge two dictionaries. `a`'s bindings win on
  values : Dict k v -> List v
      All values in the dictionary, in ascending order of their KEY.