Packages

A Gleam library for comparing strings/lists and producing a textual (styled) representation of the differences.

Current section

Files

Jump to
gap src util@mutable_map.erl
Raw

src/util@mutable_map.erl

-module(util@mutable_map).
-compile([no_auto_import, nowarn_unused_vars]).
-export([new/0, insert/3, get/2, keys/1, from_list/1]).
-export_type([mutable_map/2]).
-type mutable_map(Key, Value) :: any() | {gleam_phantom, Key, Value}.
-spec new() -> mutable_map(any(), any()).
new() ->
'../gap_ffi.mjs':new_mutable_map().
-spec insert(mutable_map(FQD, FQE), FQD, FQE) -> mutable_map(FQD, FQE).
insert(Map, Key, Value) ->
'..@gap_ffi.mjs':mutable_map_insert(Key, Value, Map).
-spec get(mutable_map(FQW, FQT), FQW) -> {ok, FQT} | {error, nil}.
get(Field@0, Field@1) ->
'../gap_ffi.mjs':mutable_map_get(Field@0, Field@1).
-spec keys(mutable_map(FQZ, any())) -> list(FQZ).
keys(Field@0) ->
'../gap_ffi.mjs':keys(Field@0).
-spec from_list(list(any())) -> mutable_map(any(), any()).
from_list(Field@0) ->
'../gap_ffi.mjs':from_list(Field@0).