Hacker News new | ask | show | jobs
by louthy 3664 days ago
I implemented a newtype [1] system in C#. It's (obviously) not as robust as Haskell (relies on some runtime checks), and isn't as efficient (reflection and boxing for value types). But if type-safety is what you want, it's definitely an improvement over passing integers, strings, or other basic types around.

[1] Implementation - https://github.com/louthy/language-ext/blob/master/LanguageE...

[2] Unit tests / examples - https://github.com/louthy/language-ext/blob/master/LanguageE...

[3] The request that led to the feature - https://github.com/louthy/language-ext/issues/95