There was some real controversy over this change.  People were strongly opposed to the change for exactly the reason you gave (among others), that it is hard for beginners.  However, there was enough momentum that it went through, and now things like fmap and length work on a wide variety of data types.  You can google ftp haskell controversy for more info.

On Thu, Nov 12, 2015 at 8:48 AM, Dennis Raddle <dennis.raddle@gmail.com> wrote:
Speaking of lists and history, I noticed that a lot of library functions which were formerly defined over lists (when I first looked at Haskell six years ago) are now defined on Traversable, which makes it a lot harder for beginners to read the documentation. I have been playing with Haskell for five years, but not much, so I'm still a beginner. I just mentally substitute lists when I see Traversable. 

I only really use lists and Maybe, as far as instances of the typeclasses go. That's only two types, but a lot to learn!

D




On Thu, Nov 12, 2015 at 5:42 AM, akash g <akaberto@gmail.com> wrote:

On Thu, Nov 12, 2015 at 7:11 PM, akash g <akaberto@gmail.com> wrote:
map is specialized for lists while fmap is for any functors.  Its presence is historical.  Prefer fmap over map.

On Thu, Nov 12, 2015 at 7:03 PM, Dennis Raddle <dennis.raddle@gmail.com> wrote:
Just after I posted that question, I started driving home, and on the drive I thought of your answer. I think I'm starting to ask the right questions when I'm programming in Haskell. Like redundancy and bloat is a sure sign that a more witty expression is available, and that I should consult the typeclasses. 

Second, I am not used to the implications of laziness, so it took me a while to hit on your solution because I keep thinking you have to map something over the whole list, and that if you only want to map it over the head, you are stuck. 

You can use 'map' also, instead of 'fmap', right? Is 'map' just 'fmap' for lists?

D


_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners




_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners



_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners