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. Re:  Avoiding stack space overflow (Animesh Saxena)
   2. Re:  Avoiding stack space overflow (Bob Ippolito)
   3. Re:  Saving intermediate calculations (Henk-Jan van Tuyl)


----------------------------------------------------------------------

Message: 1
Date: Tue, 10 Mar 2015 21:43:33 +0800
From: Animesh Saxena <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Avoiding stack space overflow
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

This is really nice stuff. Thanks

Animesh 

Sent from my iPhone

> On 10-Mar-2015, at 5:49 pm, Heinrich Apfelmus <[email protected]> 
> wrote:
> 
> Bob Ippolito wrote:
>> On Mon, Mar 9, 2015 at 4:15 PM, Heinrich Apfelmus <[email protected]
>>> wrote:
>>> Bob Ippolito wrote:
>>> 
>>>> Here are my go-to resources for Haskell's evaluation:
>>>> 
>>>> http://chimera.labs.oreilly.com/books/1230000000929/ch02.
>>>> html#sec_par-eval-whnf
>>>> https://hackhands.com/lazy-evaluation-works-haskell/
>>> I just wanted to mention that I have now expanded the latter resource. It
>>> is best reached from the following URL:
>>> 
>>>  https://hackhands.com/guide-lazy-evaluation-haskell/
>> Thank you, this is great! Perhaps you could also link to this from the top
>> and/or bottom of each individual article to make them all more discoverable
>> from existing links?
> 
> Good idea! I have added a link at the top of each post. Does this work as 
> intended?
> 
> 
> Best regards,
> Heinrich Apfelmus
> 
> --
> http://apfelmus.nfshost.com
> 
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

Message: 2
Date: Tue, 10 Mar 2015 13:54:17 -0700
From: Bob Ippolito <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Avoiding stack space overflow
Message-ID:
        <CACwMPm_Tg0WS=loiemejvexdhvsjwynuyec_tb89vkwda0-...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Tue, Mar 10, 2015 at 2:49 AM, Heinrich Apfelmus <
[email protected]> wrote:

> Bob Ippolito wrote:
>
>> On Mon, Mar 9, 2015 at 4:15 PM, Heinrich Apfelmus <
>> [email protected]
>>
>>> wrote:
>>>
>>
>>  Bob Ippolito wrote:
>>>
>>>  Here are my go-to resources for Haskell's evaluation:
>>>>
>>>> http://chimera.labs.oreilly.com/books/1230000000929/ch02.
>>>> html#sec_par-eval-whnf
>>>> https://hackhands.com/lazy-evaluation-works-haskell/
>>>>
>>>>  I just wanted to mention that I have now expanded the latter resource.
>>> It
>>> is best reached from the following URL:
>>>
>>>   https://hackhands.com/guide-lazy-evaluation-haskell/
>>>
>>
>>
>> Thank you, this is great! Perhaps you could also link to this from the top
>> and/or bottom of each individual article to make them all more
>> discoverable
>> from existing links?
>>
>
> Good idea! I have added a link at the top of each post. Does this work as
> intended?


Absolutely, works perfectly!

-bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20150310/5acf3435/attachment-0001.html>

------------------------------

Message: 3
Date: Wed, 11 Mar 2015 01:05:10 +0100
From: "Henk-Jan van Tuyl" <[email protected]>
To: "[email protected]" <[email protected]>, "Abhinav
        Kalawatia" <[email protected]>
Subject: Re: [Haskell-beginners] Saving intermediate calculations
Message-ID: <op.xva3u0gypz0j5l@alquantor>
Content-Type: text/plain; charset=iso-8859-15; format=flowed;
        delsp=yes

On Mon, 09 Mar 2015 16:47:06 +0100, Abhinav Kalawatia  
<[email protected]> wrote:

:
> week    actual_ sales(a)     forecast(f)                         
> forecast(f)                              forecast(f)
>  1            20                          f1 = a1  
>                              f1 = 20                                     
> f1 = 20
>  2            27                          f2 = f1 + 0.5*(a1 - f1)         
> f2 = 20 +0.5(20-20)                f2 = 20
>  3            25                          f3 = f2 +  0.5*(a2-f2)          
> f3 = 20+0.5*(27-20)               f3=23.5
>  4            22
>
>
> When I execute a function to achieve this in Haskell, I get the forecast  
> for the fourth period. Can I save the values for intermediate  
> period(1..3) also?
>
>
> Please find my Haskell code below:
> a = 0.5
> ipt = [20,27,25,22]
> avg :: [Double] -> Double
> avg (x:xs) = (a*x) + (1-a)*(avg xs)
> avg [] = 0
:

It looks to me, that mapAccumL[0] might do the trick (I haven't studied  
this in detail).

Regards,
Henk-Jan van Tuyl


[0]  
http://haddocks.fpcomplete.com/fp/7.8/20140916-162/base/Data-List.html#v:mapAccumL



-- 
Folding@home
What if you could share your unused computer power to help find a cure? In  
just 5 minutes you can join the world's biggest networked computer and get  
us closer sooner. Watch the video.
http://folding.stanford.edu/


http://Van.Tuyl.eu/
http://members.chello.nl/hjgtuyl/tourdemonad.html
Haskell programming
--


------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 81, Issue 36
*****************************************

Reply via email to