News for hackers. Stuff that matters.
Re:Thoughts on Rust, a few thousand lines in by afraca on Thursday January 10, 2019 @03:49AM (#18872468)
This is common in Haskell as well using `newtype`. You can have type aliases like

  type A = B
but you can use the following function with a B:

  f :: A -> _
whereas

  newtype EscapedString = EscapedString String
  f' :: EscapedString -> _
would prevent from using f' with the wrong data. Newtype is a zero-cost abstraction.

There are no comments on this comment yet.