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.  operations on cyclic data structures (Josh Stratton)
   2. Re:  operations on cyclic data structures (Brent Yorgey)
   3.  haskell testing framework - missing htfpp (Ovidiu D)


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

Message: 1
Date: Sun, 7 Apr 2013 11:38:23 -0700
From: Josh Stratton <[email protected]>
Subject: [Haskell-beginners] operations on cyclic data structures
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <capvmglitd4nuw6rfbftezw6d4emhgqzzo0eltkw7ltodbmu...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

I'm new to haskell and functional programming in general.  One of the
things I've tried to wrap my brain around is dealing with cyclic immutable
data structures like the half-edge data structure.

First, how would an experienced haskeller design their data structures to
perform an operation on this structure?  I've implemented this structure
with mutable structures in c++ but when when I've asked about cyclic
structures I'm pointed to research papers which overwhelm my experience in
immutable data structures like those in haskell.

Also how efficient could this structure be if only a small portion of the
mesh is updated? Would the entire mesh need to be rebuilt?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130407/fd6e8e5c/attachment-0001.htm>

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

Message: 2
Date: Sun, 7 Apr 2013 15:46:31 -0400
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] operations on cyclic data structures
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

On Sun, Apr 07, 2013 at 11:38:23AM -0700, Josh Stratton wrote:
> I'm new to haskell and functional programming in general.  One of the
> things I've tried to wrap my brain around is dealing with cyclic immutable
> data structures like the half-edge data structure.
> 
> First, how would an experienced haskeller design their data structures to
> perform an operation on this structure?  I've implemented this structure
> with mutable structures in c++ but when when I've asked about cyclic
> structures I'm pointed to research papers which overwhelm my experience in
> immutable data structures like those in haskell.

Immutability and cyclic data structures do not mix very well at all.
"Updating" an immutable structure of course really means generating a
new structure.  However, because of immutability any parts that do not
change can be shared between the old and new structures.  The parts
the must be rebuilt are only those nodes from which the updated part
is reachable.  Typically, with acyclic data structures (i.e. trees),
this part that must be updated is small, and large parts of the
structure remain unchanged and can be shared between the old and new
structures.  However, with cyclic data structures, typically every
part of the structure is reachable from every other part --- hence,
any update necessitates rebuilding the entire structure.

Another problem with cyclic data structures is that one often cannot
perform operations such as "map" without losing all the sharing.

There are solutions to this but you're right that they tend to require
a fair bit of background to understand.  The simplest way to proceed
is to assign unique identifiers to nodes and store the data structure
implicitly, e.g. by storing in each node the identifiers of its
neighbors rather than actual references to them.  In essence this is
"simulating" the ability to have mutable pointers.

Another possibility is to use a "zipper" structure to be able to "move
around" within a structure and make modifications at the "current
location".  However, this gets rather complicated for things like 2D
meshes.

A more sophisticated solution uses "abstract syntax graphs" but now we
are into cutting-edge research territory.

-Brent



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

Message: 3
Date: Mon, 8 Apr 2013 12:39:08 +0300
From: Ovidiu D <[email protected]>
Subject: [Haskell-beginners] haskell testing framework - missing htfpp
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID:
        <cakvse7v+y1ljhani+jg+aqfyuvbopf6vhsbmhpfafjlqqhw...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

I'm trying to use HTF by following this tutorial:
http://hackage.haskell.org/packages/archive/HTF/0.9.0.0/doc/html/Test-Framework-Tutorial.html

and when I build the project I get the error:
ghc: could not execute: htfpp

I'm using:
$ dpkg -l | grep haskell-platform
ii  haskell-platform
2012.2.0.0ubuntu1                         all          Standard Haskell
libraries and tools


What am I doing wrong?

Thanks,
ovidiu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130408/ca4de8a9/attachment-0001.htm>

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

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 58, Issue 17
*****************************************

Reply via email to