Back to the original problem for a moment.

\begin{code}

import qualified Data.Sequence as Seq
import Data.Sequence ((|>), ViewL((:<)))

weave :: [[a]] -> [a]
weave = weaveSeqL . Seq.viewl . Seq.fromList
 where
   weaveSeqL ((x:xs) :< s) = x : weaveSeqL (Seq.viewl $ s |> xs)
   weaveSeqL _             = []

\end{code}

Yes, it also weaves infinite lists.

Regards,
Yitz
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to