<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<div>//Existing typealias feature.</div><div>//Foo acts exactly the same way as Double. It's the same thing.</div><div>//Double can be used instead of Foo anywhere.</div><div>typealias Foo = Double</div><div><br /></div><div>//Proposed newtype feature.</div><div>//Bar acts exactly the same way as Double and is the same</div><div>//thing behind the scenes (until we extend it; see below).</div><div>//Trying to use Double instead of Bar will result in a compile-time error.</div><div>newtype Bar = Double</div><div><br /></div><div>Of course, after creating Bar - a "copy" of the type Double, so to speak - I can extend Bar independenly of Double as one would expect.</div><div><br /></div><div>This would be highly useful.</div><div><br /></div><div>Your thoughts?</div> </body>
</html>