3 ms·
As someone who doesn't understand what dependent types are, this seems opaque to me (and is probably equally opaque to anyone else who doesn't understand). You
by johnfn 6y ago
As someone who doesn't understand what dependent types are, this seems opaque to me (and is probably equally opaque to anyone else who doesn't understand). You can do this trivially with e.g. a structure-like type. E.g. in TypeScript it'd just be `type EnvironmentVariables = { otherFlags: stuff; newFlag: whatever; }` - and then you'd just have to use `EnvironmentVariables` in both the --help and in wherever you specify your environment variables.
- rowanG077 6y agoHow can you specify in typescripts a field must be used? I'm currently writing typescripts for a web app and this would come in hamdy for me.
- simlevesque 6y agoAny field present must be used. Optional fields end with ?
- rowanG077 6y agoI have never seen any typescript where any field present must be used. Can you make an example?
- johnfn 6y agoI got some downvotes on this post but it's a genuine question and I'm not trying to troll. Not sure what's going on here.