I’m finding myself doing a lot of work with Js.t('a)
right now as I write my GraphQL server that interacts with Postgres on the back-end. It’s neat-o that Js.Obj.assign({"foo": 1}, {"bar": 2})
will return a JS object that has the type {. "foo": int, "bar": int}
. It can make unions of objects!
But sometimes I need to remove an attribute from a JS object. Is there any way in the OCaml object type system to remove a field from an object? Or, I guess, if we’re talking about row polymorphism here, a way to specify that a row has been removed from a row-parameterized type?
That’d make my day.