"Jan" == Jan Kort [EMAIL PROTECTED] writes:
Anyway, a doubly linked list could be defined like this:
That was very interesting. It seems to generalise to put
back-pointers and other context info in a variety of data
structures. This seems a pretty performance-enhancing thing to do.
It
-Original Message-
From: Peter Hancock [mailto:[EMAIL PROTECTED]]
Sent: 28 April 2000 10:23
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: doubly linked list
"Jan" == Jan Kort [EMAIL PROTECTED] writes:
Anyway, a doubly linked list could be de
a
rewind a = a
ffwd (Dd _ _ a) = ffwd a
ffwd a = a
-Original Message-
From: Jerzy Karczmarczuk [mailto:[EMAIL PROTECTED]]
Sent: 28 April 2000 11:12
Cc: [EMAIL PROTECTED]
Subject: Re: doubly linked list
Jan Brosius wrote:
I wonder if it is possible to simulate a doubly
Chris Angus:
Would it not be better to tag a start point then we can manipulate this
easier
and move it back to a singly linked list etc.
data Db a = Dd (Db a) a (Db a)
| DStart (Db a) a (Db a)
...
Well, I am sufficiently old to confess that one of my favourite OO
Jerzy Karczmarczuk ([EMAIL PROTECTED]) wrote:
: But in Haskell, where the beasts are not mutable:
:
: ... Actually, has anybody really used them for practical purposes?
I have used doubly linked lists in Haskell about four
years ago to implement a queue from which objects could
be added at
"Jerzy" == Jerzy Karczmarczuk [EMAIL PROTECTED] writes:
The idea of double lists was to permit a fast two-directional
navigation,
and the ease of insertion/deletion.
But in Haskell, where the beasts are not mutable:
... Actually, has anybody really used them for
I wonder if it is possible to simulate a doubly linked list in Haskell.
No need to simulate it... it's perfectly possible. See my Wiki article.
--KW 8-)
--
: Keith Wansbrough, MSc, BSc(Hons) (Auckland) ---:
: PhD Student, Computer Laboratory, University of Cambridge, UK. :
:
I wonder if it is possible to simulate a doubly linked list in
Haskell.
Depends on what you mean.
- Using mutable state in a monad you can implement a doubly
linked list directly.
- If you store all the nodes of the doubly linked list in
an array and simulate the pointers with
Herewith the comp.lang.functional version of my article. I may have
tidied it up a little for the Wiki; if so, those changes are lost. Let
it hereby enter the Haskell List archive!
The following message is a courtesy copy of an article
that has been posted as well.
Matti Nykanen [EMAIL
- Original Message -
From: Chris Okasaki [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 27, 2000 4:13 PM
Subject: Re: doubly linked list
I wonder if it is possible to simulate a doubly linked list in
Haskell.
Depends on what you mean.
- Using mutable state
10 matches
Mail list logo