Bertram Felgenhauer wrote:
> or
> bfs next start = lefts . takeWhile (not . null)
I copied the wrong version. This should be
bfs next start = rights . concat . takeWhile (not . null)
-- rest unchanged
. unfoldr (Just . span (either (const False) (const True)) . tail)
$ fix (nub . (Left 0 :) . (Right start :)
. (>>= either ((:[]) . Left . succ) (map Right . next)))
Bertram
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe