Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
Select your favorite languages :
  • Or search :

Idiom #172 Insert entry in map

Insert value v for key k in map m.

m.k = v
m[k] = v
(assoc m k v)
m[k] = v;
m[k] = v;
m[k] = v;
m[k] = v;
m[k] = v
import qualified Data.Map as Map
newM = Map.insert k v m
m.set(k, v);
m[k] = v;
m.put(k, v);
$m[$k] = $v;
fgl
m.KeyData[k] := v;
$m{$k} = $v;
m[k] = v
m[k] = v
use std::collection::HashMap;
m.insert(k, v);

New implementation...
programming-idioms