3 ms·
In haskell this is done with newtype. Another example would be using km and miles, and making sure they are not mixed. Here there is an interesting article abo
by mejutoco 4y ago
In haskell this is done with newtype. Another example would be using km and miles, and making sure they are not mixed.
Here there is an interesting article about doing this in typescript (not affiliated)
https://kubyshkin.name/posts/newtype-in-typescript/ https://kubyshkin.name/posts/newtype-in-typescript/