[Haskell-beginners] question about list processing

akash g akaberto at gmail.com
Thu Nov 12 14:31:26 UTC 2015


There has been discussion on the changes to the Prelude.  Just found this (
https://wiki.haskell.org/Foldable_Traversable_In_Prelude).



On Thu, Nov 12, 2015 at 7:57 PM, akash g <akaberto at gmail.com> wrote:

> I think these changes came with GHC 7.10.  I also completely agree that
> this is difficult for beginners.  They should've had a beginner's Prelude
> or something :)
>
>
>
> On Thu, Nov 12, 2015 at 7:18 PM, Dennis Raddle <dennis.raddle at 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 at gmail.com> wrote:
>>
>>>
>>> http://stackoverflow.com/questions/7463500/why-do-we-have-map-fmap-and-liftm
>>> have very good answers on this.
>>>
>>> On Thu, Nov 12, 2015 at 7:11 PM, akash g <akaberto at 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 at 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 at haskell.org
>>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>>>
>>>>>
>>>>
>>>
>>> _______________________________________________
>>> Beginners mailing list
>>> Beginners at haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>>>
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20151112/526e4860/attachment-0001.html>


More information about the Beginners mailing list