Remix.run Logo
shevy-java 5 hours ago

> Haskell provides indexable arrays, which may be thought of as functions whose domains are isomorphic to contiguous subsets of the integers.

> I found this to be a hilariously obtuse and unnecessarily formalist description of a common data structure.

Well it is haskell. Try to understand what a monad is. Haskell loves complexity. That also taps right into the documentation.

> I look at this description and think that it is actually a wonderful definition of the essence of arrays!

I much prefer simplicity. Including in documentation.

I do not think that description is useful.

To me, Arrays are about storing data. But functions can also do that, so I also would not say the description is completely incorrect either.

> who can say that it is not actually a far better piece of documentation than some more prosaic description might have been?

I can say that. The documentation does not seem to be good, in my opinion. Once you reach this conclusion, it is easy to say too. But this is speculative because ... what is a "more prosaic description"? There can be many ways to make a worse documentation too. But, also, better documentation.

> To a language designer, the correspondence between arrays and functions (for it does exist, independent of whether you think it is a useful way to document them) is alluring, for one of the best ways to improve a language is to make it smaller.

I agree that there is a correspondence. I disagree that Haskell's documentation is good here.

> currying/uncurrying is equivalent to unflattening/flattening an array

So, there are some similarities between arrays and functions. I do not think this means that both are equivalent to one another.

> would like to see what it would be like for a language to fully exploit the array-function correspondence.

Does Haskell succeed in explaining what a Monad is? If not, then it failed there. What if it also fails in other areas with regards to documentation?

I think you need to compare Haskell to other languages, C or Python. I don't know if C does a better job with regards to its documentation; or C++. But I think Python does a better job than the other languages. So that is a comparison that should work.

lukebitts 4 hours ago | parent [-]

Some people really do look at a painting and see only brush strokes huh

morshu9001 2 hours ago | parent [-]

At this point I look at a painting and think, they should've used JS