[Haskell-cafe] Links into list

Felipe Almeida Lessa felipe.lessa at gmail.com
Mon May 2 13:32:18 CEST 2011


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.



More information about the Haskell-Cafe mailing list