Relude variants and interop with JS


#1

Relude types get generated like this with integer TAG names.

{ TAG: 0, _0: { _0: 'test' } }

With normal Belt types

[@genType]
let validate = s => Ok(Question(s));

Becomes

{ tag: 'Ok', value: { tag: 'Question', value: 'test' } }

But if I use the Relude_Result type it gets generated as

[@genType]
let validate3 = s => Relude_Result.Ok(Question(s));

{ TAG: 0, _0: { _0: 'test' } }

My question is then if I were interoping with Javascript/typescript, how can I get more friendly names or translate the tags when calling from the TS side?