Ok so I’ve got this
@unboxed type queryParamTypes = I(int) | S(string) | @as(undefined) Undefined
let f = (~x: int, ~y: string, ~z=Undefined) => {
[I(x), S(y), z]
}
let r = f(~x=1, ~y="two")
Console.log(r) //=> [ 1, 'two', undefined ]
let r = f(~x=1, ~y="two", ~z=Undefined)
Console.log(r) //=> [ 1, 'two', undefined ]
let r = f(~x=1, ~y="two", ~z=I(100))
Console.log(r) //=> [ 1, 'two', 100 ]
Its pretty good. A little awkward, especially at the [I(x), S(y), z] part. Is that the ergonomic its gonna get?