Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/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: IO loops with tail call (Yasuyuki Ogawa)
2. Question about recursion (Nadav Chernin)
3. Re: Question about recursion (Brent Yorgey)
4. Friend Modules? (John Smith)
----------------------------------------------------------------------
Message: 1
Date: Tue, 09 Nov 2010 21:17:43 +0900
From: Yasuyuki Ogawa <[email protected]>
Subject: Re: [Haskell-beginners] IO loops with tail call
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi Edgar,
Thank you for interesting wiki pages!
Roughly speaking, because of laziness, tail recursion is not always
necessary, modulo cons but useful enough...or something like that?
I'll study!
-- Yasuyuki
(2010/11/08 19:21), edgar klerks wrote:
> Hi Yasuyuki,
>
> Here is some resource Brent produced, why tail-recursion isn't that
> important in haskell:
>
> http://www.haskell.org/pipermail/haskell-cafe/2009-March/058607.html
> (http://www.haskell.org/haskellwiki/Tail_recursion)
>
> I think it is nice to have some background (and it is pretty interesting).
>
> Greets,
>
> Edgar
--------------------------------------
Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
http://pr.mail.yahoo.co.jp/ie8/
------------------------------
Message: 2
Date: Tue, 9 Nov 2010 18:14:49 +0200
From: "Nadav Chernin" <[email protected]>
Subject: [Haskell-beginners] Question about recursion
To: <[email protected]>
Message-ID:
<[email protected]_tree.local>
Content-Type: text/plain; charset="us-ascii"
Hi, all
I wrote function that delete elements from list by indexes:
delIndexes::[Int]->[a]->[a]
delIndexes [] list = list
delIndexes _ [] = []
delIndexes indexes list = take x list ++ delIndexes ( map (\y->y-x-1)
xs ) ( drop (x+1) list(
where
)x:xs)=sort indexes
There is problem that in each step of recursion this function sort list
of indexes ( in last line)
How can I write this code that sorting will be executed only once (in
first step)?
Thank you, Nadav
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20101109/058f3d25/attachment-0001.html
------------------------------
Message: 3
Date: Tue, 9 Nov 2010 11:20:25 -0500
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] Question about recursion
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
On Tue, Nov 09, 2010 at 06:14:49PM +0200, Nadav Chernin wrote:
>
> There is problem that in each step of recursion this function sort list
> of indexes ( in last line)
>
> How can I write this code that sorting will be executed only once (in
> first step)?
Just write a helper function that does all the actual work, and have
delIndexes pass it a sorted index list as input:
delIndexes inds l = delIndexes' (sort ind) l
where delIndexes' ...
-Brent
------------------------------
Message: 4
Date: Tue, 09 Nov 2010 19:00:59 +0200
From: John Smith <[email protected]>
Subject: [Haskell-beginners] Friend Modules?
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
I have a module which defines data structures and their functions for a
program. I have another module which defines
show methods for the structures. Both modules have a substantial amount of
code, and I would prefer to keep them
separate. However, the show methods require access to internal data structures,
which would not normally be exported.
Furthermore, many modules do not require the show functions. Is there any
solution to this, other than an intermediate
module which imports the data module, and only exports the required names?
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 29, Issue 11
*****************************************