Re:What else are we getting wrong about programming languages?
by tome on Wednesday November 02, 2016 @06:22AM
(#12853412)
> Let's say you have a function in a library that has signature Int32 -> Int32. Then you realize you need to do the same thing, but for Int64. You can't reuse it by wrapping.
For that we have typeclasses.
Let's say you have a function in a library that has signature Int32 -> Int32. Then you realize you need to do the same thing, but for Int64. You can't reuse it by wrapping.
The above can seem silly, but problems like that are very real for Haskell strings.
I mean, from type-purity perspective, this behavior is OK. But from practical perspective (like Python's), it's a bummer. Why you shouldn't be able to reuse existing code just with different type signatures?