3 ms·
Neat, but there's a subtelty: at the end of the article, we only proved that square is error-free[0] when given an Int as input (because the haskell version of
by cpa 12y ago
Neat, but there's a subtelty: at the end of the article, we only proved that square is error-free[0] when given an Int as input (because the haskell version of square is Int -> IO Int). But Python being loosely typed, I could call square on a float, and in this case nothing can be said of the python function.
Also, you have to make sure haskell's Ints and Python's Int are the same on your platform (one could be 32 bits and the other 64 bits).
[0] we did not prove anything, but just ran a bunch of tests, but you get the point.
- Ded7xSEoPKYNsDd 12y ago> Also, you have to make sure haskell's Ints and Python's Int are the same on your platform (one could be 32 bits and the other 64 bits). Aren't they both infinite-resolution?
- DRMacIver 12y agoNo, the infinite precision integer type in Haskell is called Integer. Int is a platform dependent fixed size int.