• Newtype. 22,354 likes · 137 talking about this · 304 were here. Build The Future.
  • new typing.works.
  • import { Newtype, iso } from 'newtype-ts'. interface EUR extends Newtype<{ readonly EUR: unique symbol }, number> {} //.
    • Issues:
      5
    • Last commit:
      17 January 2022
    • By removing the cryptic curtain NEWTYPE keeps upfront costs minimized.
    • NEWTYPE believes in keeping rights where they belong–with you.
    • NEWTYPE gets you Chicago-based distribution with a fully-armed sales team.
  • This is useful when you want to simplify complex type signatures. In contrast, NewType declares one type to be a subtype of another.
  • A Newtype was someone who was in a new stage of human evolution, a new type of human. The term Newtype was coined by Zeon Zum Deikun.
  • The converse is not true, however - data can only be replaced with newtype if the type has exactly one constructor with exactly one field inside it.
  • import { Newtype, iso } from 'newtype-ts'. interface EUR extends Newtype<{ readonly EUR: unique symbol }, number> {} //.
  • The newtype keyword allows us to define a new type that has the same runtime representation as another type.