[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
 where
   search next = next rootLoc >>= searchTree pred

Regards,
Yitz


More information about the Haskell-Cafe mailing list