Hello everyone, is there any links or resources about “maps” package in motoko?
The documentation is a bit of short and i don’t understand it because im a newbie here.
This example works
let map = Map.new<Nat, Nat>();
Map.set(map, nhash, 1, 1);
But when i do
Map.put(map, nhash, 1, 1);
it gives me this error
cannot implicitly instantiate function of type
<K, V>(Map__3<K, V>, HashUtils__3<K>, K, V) -> ?V
to argument of type
([var ?([var ?Nat], [var ?Nat], [var Nat], [var Nat32])],
(Nat -> Nat32, (Nat, Nat) -> Bool), Nat, Nat)
to produce result of type
()
because no instantiation of K__195, V__162 makes
([var ?([var ?Nat], [var ?Nat], [var Nat], [var Nat32])],
(Nat -> Nat32, (Nat, Nat) -> Bool), Nat, Nat) <:
(Map__3<K__195, V__162>, HashUtils__3<K__195>, K__195, V__162)
and
?V__162 <: ()Motoko(M0098)