3 ms·
Interesting, I have never used Haskell, only read tutorials and articles about it, but I don't get why the Foldable version should be harder for a beginner. In
by BlackMonday 11y ago
Interesting, I have never used Haskell, only read tutorials and articles about it, but I don't get why the Foldable version should be harder for a beginner.
Instead of explaining that [a] is a List of a's, and then explaining what a list is, you explain that t is a container that is foldable which contains a's.
Does he really need to know the exact details of what a typeclass is?
- dmit 11y agoFor one, "fold" is a foreign concept to people who were introduced to programming using an average imperative language. I understand that it's easier to comprehend if you mentally translate `Foldable t => t a` to `Iterable<T>`, but even Iterable is a lossy analogy. I'm not sure any mainstream language has a type that is equivalent to Haskell's Foldable. I'm guessing you have experience with languages that have generic types. The issue with the new Haskell prelude is that not only do you have to grok generic typing in order to write the most basic of Hello World introductory programs, you also have to be able to make sense of the Haddock docs. And that now requires knowledge of the type class syntax as well as basic understanding of generic programming. Whereas previously you could have softened the blow by teaching the special case of "[a] means a collection of a" first, and ramping up to more precise definitions later. Overall, I'm supportive of the FTP initiative. But I can't shake the thought that the vast majority of people who voted for FTP have long passed the point where they can fully understand the downsides of the change for others.