87 karma · joined August 10, 2011
Moorhead's review literally contains this sentence:
> The new M1 processor is impressive, but far from perfect- it has many warts, that nearly nobody is discussing.
He then proceeds to describe not warts of the M1 as a processor, but rather warts of the 3rd party software ecosystem. I think overall the review is fine and not in bad faith, but it's easy to see how people are latching on to that sentence. If he were honest about making it a review about the overall product experience, rather than the silicon, he wouldn't need to write that sentence.
As for whether the example is being "dismissed" or not, I also think that's manifestly false. See: "[this tradeoff] is often a very good one!" while still diving into exactly what the tradeoff is.
Your second point is certainly arguable and does represent a substantive disagreement with the post unlike your first comment. I think the post makes a solid case that gratuitous use of newtype absent any abstraction boundary is an anti-pattern that provides little benefit if conversions are done ad hoc. Sprinkling on some newtype can certainly help some cases, but the post encourages critical thinking about these issues and explores where this reasoning falls down. If your claim is that critical thinking gets in the way of cargo-culting approaches that lead to "nominal" type safety then you would be right. Your last parenthetical doesn't seem like a reasonable response of someone who has read and understood this post. The post specifically encourages the use of newtype with abstraction boundaries where practical and works through an example.
> the claim that newtype-based approaches are not type safety
To use your phrasing, the claim is that newtypes do not in and of themselves provide type safety, but that "newtype-based approaches" can and do provide a weaker form of safety than constructive modeling. Further, it's important to understand what the critical additional steps are in such approaches to achieving that safety and avoid cargo-culting "newtypes make things type-safe", and to understand the ways this safety can be violated.
http://c-faq.com/aryptr/aryptrequiv.html http://c-faq.com/decl/strlitinit.html
The question is very specifically about the interpretation of the slope, and because the slope would be different for the other case, only one of the answers is correct.
a :: Double
a = 2^53
b :: Double
b = 2.0^53
c :: Double
c = 2^53 + 1
main :: IO ()
main = do
print $ a == b -- True
print $ b == c -- True
print $ a == c -- TrueBasically, the third line is not like the other two. Because none of the numbers involved in #3 are Doubles, Haskell will actually use the Integer type, which is basically a bignum (like integers in Python).
The first two are comparing values of type Double, so the instance of Eq for Double is used, which necessarily has some inaccuracies, as shown in the second line, while the last one is using the instance of Eq for Integer. Therefore, the statement that (==) is not transitive for these types is false, because we are talking about different versions of (==) in the first two examples vs. the last one.
The trick is that bare numeric literals have type Num a => a, and have their type inferred by their use. The first two examples cause the 2^53 to take on type Double, otherwise it wouldn't type check (literals with decimals in them have type Fractional a => a, of which Double is the default). The last one doesn't have any expressions with decimals, so it uses the Integer type.