Managers Are Dead, Long Live Managers
medium.com3 pointsby justhelpingout0 comments
[1]: https://www.win.tue.nl/~aeb/linux/hh/thompson/trust.html sqlite3 .tup/db 'select name from node where type=4' | xargs echo rm -f
[1]: https://github.com/gittup/tup/issues/120#issuecomment-64832104 interface Nominal<T> {
'nominal type tag': T
}
class As<T> {
private tag: T
}
Both are used in the same manner: const enum SomeTag { }
type Something = number & As<SomeTag>
// or
type Something = number & Nominal<SomeTag>
You can even avoid the boilerplate of `const enum` if you make the `T` of `As` or `Nominal` `T extends string`: type Something = number & As<'some:unique:string:tag'>
In both cases, the values are not unified, so: type Something = number & As<'kind1'>
type SomethingElse = number & As<'kind2'>
var x: Something = 123 as Something;
var y: SomethingElse = 456 as SomethingElse;
x = y; // Type 'SomethingElse' is not assignable to type 'Something'.