Function can accept unknown type?


#1

Hi,

I was wondering if it was possible to create a function that can accept unknown type. For example, I would like to perform the following:

myFunc.sendPayload(id, {
   "a": 1,
   "b": "string",
   "c": someOtherType
});

I tried defining it as:
let myFunct = Js.t({…}) => unit;

But it is not possible with “A type variable is unbound in this type declaration” error.

Still learning Reason and not sure how to do this the right way. Appreciate your guidance!


#2

Hi,
Use type variable, for example 'a.