Comment by inigyou
2 days ago
Haskell: newtype ShoeSize = ShoeSize Integer
(The first ShoeSize is the type name, the second is the name of the constructor that converts an integer to one, or pattern-matches on it. This is unambiguous in Haskell and they are often the same. It has symmetry with "data" which is for more general ADTs that can have more than one constructor.)
No comments yet
Contribute on Hacker News ↗