const stronglyTypedHashMap = pipe(
HashMap.empty(),
HashMap.set("foo" as const, "bar" as const),
HashMap.set("fizz" as const, "buzz" as const),
);
// Because "foo" is passed in, the only possible value is "bar"
const mustBeBar = HashMap.get("foo" as const)(stronglyTypedHashMap); // 'bar'
// Because "fizz" is passed in, the only possible value is "buzz"
const mustBeBuzz = HashMap.get("fizz" as const)(stronglyTypedHashMap); // 'buzz'
const stronglyTypedHashMap = pipe(
HashMap.empty(),
HashMap.set("foo" as const, "bar" as const),
HashMap.set("fizz" as const, "buzz" as const),
);
// Because "foo" is passed in, the only possible value is "bar"
const mustBeBar = HashMap.get("foo" as const)(stronglyTypedHashMap); // 'bar'
// Because "fizz" is passed in, the only possible value is "buzz"
const mustBeBuzz = HashMap.get("fizz" as const)(stronglyTypedHashMap); // 'buzz'