[Haskell-cafe] Re: search Data.Tree.Zipper

Yitzchak Gale gale at sefer.org
Tue Mar 9 16:26:54 EST 2010

Jian Fan wrote:
> Following is what I have for now...

Oh, nice! That is simpler. Now we can do:

searchTree pred rootLoc
 | pred (getLabel rootLoc) = Just rootLoc
 | otherwise               = search right `mplus` search firstChild
   search next = next rootLoc >>= searchTree pred


More information about the Haskell-Cafe mailing list