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: 2 Questions: mutable data and copying results (C Gosch)
2. Re: 2 Questions: mutable data and copying results
(Daniel Fischer)
3. Re: Man/dir/help pages for haskell? (aditya siram)
4. Re: Man/dir/help pages for haskell? (Daniel Fischer)
----------------------------------------------------------------------
Message: 1
Date: Tue, 17 Aug 2010 16:08:49 +0200
From: C Gosch <[email protected]>
Subject: Re: [Haskell-beginners] 2 Questions: mutable data and copying
results
To: Johan Tibell <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hi Johan,
thanks for the quick answer!
2010/8/17 Johan Tibell <[email protected]>
The second question is this: say I have some functions working with a
data type, say a graph.
> Some of them might want to change the graph and return a new graph as a
>> result.
>> If they change say only one graph node, it would be extremely bad for
>> performance if the whole graph got copied
>> any time such a change takes place. Is the compiler smart enough to make
>> the code only copy the parts
>> that have changed (copying lazily, so to speak)? Is that even possible?
>>
>
> Since the graph is immutable most of the nodes in the new graph are shared
> with nodes in the old graph. This is know as path copying and is everywhere
> persistent ("immutable") data structures are used. Updating a data structure
> (e.g. a tree) typically requires O(log n) nodes to be copied.
>
>
So that means the compiler figures this out for my own data structures, or
do I have to take care that copying is done this way?
Sorry for my ignorance, I'm still learning :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20100817/81b305ec/attachment-0001.html
------------------------------
Message: 2
Date: Tue, 17 Aug 2010 16:26:12 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] 2 Questions: mutable data and copying
results
To: [email protected]
Cc: C Gosch <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
On Tuesday 17 August 2010 16:08:49, C Gosch wrote:
> >
> > Since the graph is immutable most of the nodes in the new graph are
> > shared with nodes in the old graph. This is know as path copying and
> > is everywhere persistent ("immutable") data structures are used.
> > Updating a data structure (e.g. a tree) typically requires O(log n)
> > nodes to be copied.
>
> So that means the compiler figures this out for my own data structures,
> or do I have to take care that copying is done this way?
> Sorry for my ignorance, I'm still learning :)
It's done automatically (and, if your nodes contain huge data, you'll be
happy to learn tha the data isn't copied at all, only the pointers to it).
------------------------------
Message: 3
Date: Tue, 17 Aug 2010 09:53:00 -0500
From: aditya siram <[email protected]>
Subject: Re: [Haskell-beginners] Man/dir/help pages for haskell?
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Is there some way of retroactively doing this for packages that are already
cabal installed?
-deech
On Tue, Aug 17, 2010 at 5:40 AM, Daniel Fischer <[email protected]>wrote:
> On Tuesday 17 August 2010 07:39:15, Magnus Therning wrote:
> > On 17/08/10 05:01, Kevin Burke wrote:
> > > Hello,
> > > I've been learning Haskell by working through the O'Reilly book, but a
> > > lot of the coding I do is offline. One thing that's been really
> > > helpful in other languages are the terminal instructions and detail
> > > for functions. Is there something similar for Haskell? I know I can
> > > type :help at the prompt but that only gives you info on the broad
> > > commands.
> >
> > I would suggest installing the haddock documentation for all
> > packages/modules
> > you use. Depending on your system that may already be the case (e.g.
> > Arch), or you may have to install separate document packages (e.g.
> > Debian). If you install manually, using 'cabal', then there really
> > ought to be some way of also compiling the docs and installing them.
>
> Set
>
> documentation: True
>
> in ~/.cabal/config
>
> to automatically build local docs for each installed package.
> Also it might be a good idea to set
>
> library-profiling: True
>
> there.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20100817/98644594/attachment-0001.html
------------------------------
Message: 4
Date: Tue, 17 Aug 2010 16:57:14 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Man/dir/help pages for haskell?
To: aditya siram <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
On Tuesday 17 August 2010 16:53:00, aditya siram wrote:
> Is there some way of retroactively doing this for packages that are
> already cabal installed?
I'm afraid there isn't. You have to do it manually or write a script to do
it.
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 26, Issue 35
*****************************************