Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Haskell code optimisation (Abhishek Kumar)
2. Doubts about functional programming paradigm (Abhishek Kumar)
3. Re: Doubts about functional programming paradigm (Sanatan Rai)
4. Re: Doubts about functional programming paradigm
(Sumit Sahrawat, Maths & Computing, IIT (BHU))
5. Re: Haskell code optimisation
(Sumit Sahrawat, Maths & Computing, IIT (BHU))
6. Re: Doubts about functional programming paradigm
(Imants Cekusins)
----------------------------------------------------------------------
Message: 1
Date: Fri, 11 Dec 2015 20:17:47 +0530
From: Abhishek Kumar <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] Haskell code optimisation
Message-ID:
<caeagxqw3snuv4zpt9frqjlsycjmgm7_aalzwp+sysvvetth...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
I was trying to write below program for ackerman function but it fails
(waits too long) for ack(4,1) whereas a recursive C program gives result in
37secs.Can someone pls explain this behaviour and recomend some
optimisation.
------haskell code
f m n | m==0 =n+1
| n==0 = f (m-1) 1
| otherwise = f (m-1) (f m (n-1))
Thanks
Abhishek Kumar
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151211/0d1eb291/attachment-0001.html>
------------------------------
Message: 2
Date: Fri, 11 Dec 2015 20:37:19 +0530
From: Abhishek Kumar <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] Doubts about functional programming
paradigm
Message-ID:
<caeagxquc4-vpc57nx13nfezot-q8_vtnezpeq_lx7sg6ytp...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
I am a beginner in haskell.I have heard a lot about haskell being great for
parallel programming and concurrency but couldn't understand why?Aren't
iterative algorithms like MapReduce more suitable to run parallely?Also how
immutable data structures add to speed?I'm having trouble understanding
very philosophy of functional programming, how do we gain by writing
everything as functions and pure code(without side effects)?
Any links or references will be a great help.
Thanks
Abhishek Kumar
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151211/66ee35dc/attachment-0001.html>
------------------------------
Message: 3
Date: Fri, 11 Dec 2015 15:12:37 +0000
From: Sanatan Rai <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Doubts about functional programming
paradigm
Message-ID:
<camw38aqcsjj3khzirjlwbewyhk0egycp7gorypgn+4gwc7y...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
I'd recommend writing out some code and then deciding. Functional
programming is not a panacea, just the challenges are in different places.
Proponents claim that the challenges are in the *right* place. Your mileage
might vary.
I recommend working through 'Real World Haskell' as a good place to start.
--Sanatan
On 11 Dec 2015 15:07, "Abhishek Kumar" <[email protected]> wrote:
> I am a beginner in haskell.I have heard a lot about haskell being great
> for parallel programming and concurrency but couldn't understand why?Aren't
> iterative algorithms like MapReduce more suitable to run parallely?Also how
> immutable data structures add to speed?I'm having trouble understanding
> very philosophy of functional programming, how do we gain by writing
> everything as functions and pure code(without side effects)?
> Any links or references will be a great help.
> Thanks
> Abhishek Kumar
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151211/4e55adcc/attachment-0001.html>
------------------------------
Message: 4
Date: Fri, 11 Dec 2015 20:44:39 +0530
From: "Sumit Sahrawat, Maths & Computing, IIT (BHU)"
<[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Doubts about functional programming
paradigm
Message-ID:
<CAJbEW8ORcES=Q+m0zJf_HY6MmukFRc3Y57OOT5X4-dJWmG=y...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
If you're looking to start, I'll recommend the learnhaskell guide:
https://github.com/bitemyapp/learnhaskell
On 11 December 2015 at 20:42, Sanatan Rai <[email protected]> wrote:
> I'd recommend writing out some code and then deciding. Functional
> programming is not a panacea, just the challenges are in different places.
> Proponents claim that the challenges are in the *right* place. Your mileage
> might vary.
>
> I recommend working through 'Real World Haskell' as a good place to start.
>
> --Sanatan
> On 11 Dec 2015 15:07, "Abhishek Kumar" <[email protected]> wrote:
>
>> I am a beginner in haskell.I have heard a lot about haskell being great
>> for parallel programming and concurrency but couldn't understand why?Aren't
>> iterative algorithms like MapReduce more suitable to run parallely?Also how
>> immutable data structures add to speed?I'm having trouble understanding
>> very philosophy of functional programming, how do we gain by writing
>> everything as functions and pure code(without side effects)?
>> Any links or references will be a great help.
>> Thanks
>> Abhishek Kumar
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
--
Sumit Sahrawat,
Junior - Mathematics and Computing,
Indian Institute of Technology - BHU,
Varanasi, India
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151211/90f137bc/attachment-0001.html>
------------------------------
Message: 5
Date: Fri, 11 Dec 2015 20:47:12 +0530
From: "Sumit Sahrawat, Maths & Computing, IIT (BHU)"
<[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Haskell code optimisation
Message-ID:
<cajbew8nmlz7tyjfrjrqwkkdj138zgkkxvsjhyshh_srdwp6...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Graham Hutton's paper "A tutorial on the expressiveness and universality of
folds", provides a good introduction to folds, and implements the Ackerman
function as an example.
Folds were the first stumbling point for me when learning Haskell, and this
paper helped me a lot.
On 11 December 2015 at 20:17, Abhishek Kumar <[email protected]>
wrote:
> I was trying to write below program for ackerman function but it fails
> (waits too long) for ack(4,1) whereas a recursive C program gives result in
> 37secs.Can someone pls explain this behaviour and recomend some
> optimisation.
>
> ------haskell code
> f m n | m==0 =n+1
> | n==0 = f (m-1) 1
> | otherwise = f (m-1) (f m (n-1))
>
> Thanks
> Abhishek Kumar
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
--
Sumit Sahrawat,
Junior - Mathematics and Computing,
Indian Institute of Technology - BHU,
Varanasi, India
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151211/c8c7103b/attachment-0001.html>
------------------------------
Message: 6
Date: Fri, 11 Dec 2015 16:28:02 +0100
From: Imants Cekusins <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Doubts about functional programming
paradigm
Message-ID:
<CAP1qinYSybs_z_T+RfZmnnmzk0XQV99z0JrK+=fbD5NBy=u...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
> parallel programming and concurrency but couldn't understand why?
Let's experiment: spread a programming task across large teams.
in project A each programmer work on their area but may also change
other's code. Programmers also depend on the progress their
colleagues' make.
in project B each programmer works on their own code with inputs and
putputs well defined. There is no dependency on other programmers.
Even if you did not work in both scenarios (project A & B), it is
probably easy to imagine how both projects could progress.
> how immutable data structures add to speed?
immutable data structures add to reliability.
> what do we gain by writing everything as functions and pure code(without side
> effects)?
pure code gives consistency and allows to split larger programs into
parts without fear for end result.
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 90, Issue 18
*****************************************