[Haskell-cafe] Links into list
John Sneer
johnsneer at operamail.com
Mon May 2 13:35:37 CEST 2011
Well, I have more or less similar solution, but its efficiency for
map/foldr etc. is quite low :-(
Nevertheless, probably no other solution.
BR and thanks
John
--
John Sneer
johnsneer at operamail.com
On Mon, 02 May 2011 08:32 -0300, "Felipe Almeida Lessa"
<felipe.lessa at gmail.com> wrote:
> On Mon, May 2, 2011 at 8:16 AM, Ivan Lazar Miljenovic
> <ivan.miljenovic at gmail.com> wrote:
> > On 2 May 2011 11:10, John Sneer <johnsneer at operamail.com> wrote:
> >> Hello all,
> >>
> >> I have rather strange question. I wonder whether there is an obvious
> >> solution or not in Haskell. I tried but without defining quite
> >> ugly tree-like structures and incorporating IORefs it seems to me like
> >> impossible.
> >
> > What you want seems more applicable to a Sequence rather than a list.
>
> Or a mutable list, something like
>
> data MList s a = Nil | Cons (STRef s a) (STRef s (MList s a))
>
> Cheers,
>
> --
> Felipe.
>
--
http://www.fastmail.fm - Email service worth paying for. Try it for free
More information about the Haskell-Cafe
mailing list