[Haskell-cafe] Weaving fun

Dominic Steinitz dominic.steinitz at blueyonder.co.uk
Wed Apr 11 16:35:22 EDT 2007


I've been dying to do this all day but work and then family intervened.

Dominic.

import Data.List

weave =
   unfoldr f
      where
         f ([],_,_)     = Nothing
         f (x:xs,[],zs) = Just (x,([],[],[]))
         f (x:xs,ys,zs) = Just (x,(ys,zs,xs))



More information about the Haskell-Cafe mailing list