Remix.run Logo
mcphage 9 hours ago

> Unfortunately, this decision completely defeats the purpose of adding a function similar to Map.take!, as the goal of the function is to return a map where we are certain the given keys exist!

I mean, if you define a function calling Map.take! that returns one of two possible set of keys based on a random number, I’m not sure it’s actually possible to get a map where you’re certain what keys exist.

codebje 5 hours ago | parent | next [-]

That particular contrived example is another case of "Map Any to Any is the only data structure" leaking into the thinking about types. If there's two alternatives, use an algebraic data type to express that.

travisgriggs 9 hours ago | parent | prev [-]

I think his point was any logic branch which branches on any state injected by the world outside of the compilation scope.