So I am trying to implement Result type myself just to learn the basics, while the docs are there and good wherever they are, I can't seem to find out how to do a discriminated union / sum type. I want something to the effect of this in typescript: type Ok = { ok: true, data: T, error: null } type Err = {ok: false, data: null, error: E } type Result = Ok | Err what is the most idiomatic way of doing this in nim? Sorry, this is a bit too fundamental to be asking about and I think I need to do my due dilligence here, but I cannot find an idiomatic way for the life of me