He Stephen<br><br>Thanks for the tip. I will test the performance of Data.Sequence against Immutable arrays. <br><br> I
also have another question about deriving monads. I have modified
Data.List.Zipper, so it supports 2 extra directions (up and down):<br>
<br>data Zipper a = Zip [a] [a] [a] [a]<br><br>Now I made a functor out of it:<br><strong></strong><br>instance Functor Zipper where<br>        -- fmap :: (a -&gt; b) -&gt; f a -&gt; f b<br>        f `fmap` (Zip ls rs ds us) = Zip  (f `fmap` ls) (f `fmap` rs) (f `fmap` ds) (f `fmap` us)<br>

<br>This works. Now I try to make an monad out of it:<br><br>instance Monad Zipper where <br>     return a = Zip [a] [] [] []<br>     (Zip ls rs ds us) &gt;&gt;= f = Zip (ls &gt;&gt;= f) (rs &gt;&gt;= f) (ds &gt;&gt;= f) (us &gt;&gt;= f)<br>

<br>This doesn&#39;t work like expected, but when using the newtype derive mechanism it works.<br><br>Thanks for all your help so far. <br><br>Best Wishes,<br><font color="#888888"><br>Edgar</font>