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 johnsn...@operamail.com On Mon, 02 May 2011 08:32 -0300, "Felipe Almeida Lessa" <felipe.le...@gmail.com> wrote: > On Mon, May 2, 2011 at 8:16 AM, Ivan Lazar Miljenovic > <ivan.miljeno...@gmail.com> wrote: > > On 2 May 2011 11:10, John Sneer <johnsn...@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 _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe