News for hackers. Stuff that matters.
Re:Twenty five thousand dollars of funny money by mejutoco on Saturday December 03, 2022 @12:14PM (#33845084)
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/

There are no comments on this comment yet.