diff --git a/Data/Label/Zipper.hs b/Data/Label/Zipper.hs index 22e9fd8..0344d94 100644 --- a/Data/Label/Zipper.hs +++ b/Data/Label/Zipper.hs @@ -104,7 +104,7 @@ module Data.Label.Zipper ( -- *** Repeating movements , moveWhile , moveUntil - , repeatMove + , moveFloor -- ** The zipper focus -- | a "fclabels" lens for setting, getting, and modifying the zipper's -- focus. Note: a zipper may fail to 'close' if the lens used to reach the @@ -431,16 +431,14 @@ instance Motion Flatten where --------------- REPEATED MOTIONS ----------------- --- TODO: or call this moveFloor? - -- | Apply the given Motion to a zipper until the Motion fails, returning the --- last location visited. For instance @repeatMove (to left) z@ might return +-- last location visited. For instance @moveFloor (to left) z@ might return -- the left-most node of a 'zipper'ed tree @z@. -- --- > repeatMove m z = maybe z (repeatMove m) $ move m z -repeatMove :: (Motion m,Typeable a, Typeable b)=> +-- > moveFloor m z = maybe z (moveFloor m) $ move m z +moveFloor :: (Motion m,Typeable a, Typeable b)=> m b b -> Zipper a b -> Zipper a b -repeatMove m z = maybe z (repeatMove m) (move m z) +moveFloor m z = maybe z (moveFloor m) (move m z) -- | Apply a motion each time the focus matches the predicate, raising an error -- in @m@ otherwise diff --git a/Tests.hs b/Tests.hs index 504e166..32b315e 100644 --- a/Tests.hs +++ b/Tests.hs @@ -111,9 +111,9 @@ prop_builtin_recursive_movement i = z = zipper l mz'1 = moveUntil null (to lTail) z - z'2 = repeatMove (to lTail) z + z'2 = moveFloor (to lTail) z -- test that both have level equal to length of list: - testLength z1 z2 | level z1 /= i' = P.failed{P.reason = "repeatMove broken" } + testLength z1 z2 | level z1 /= i' = P.failed{P.reason = "moveFloor broken" } | level z2 /= i' = P.failed{P.reason = "moveUntil broken" } | otherwise = P.succeeded diff --git a/pez.cabal b/pez.cabal index e667d62..7ef2544 100644 --- a/pez.cabal +++ b/pez.cabal @@ -16,7 +16,6 @@ Description: PEZ is a generic zipper library. It uses lenses from the "f Changes 0.0.4 -> 0.1.0: . > - use fclabels 1.0 - > - zipper operations in Maybe by default > - module renamed Data.Label.Zipper > - 'ZPath' renamed 'Motion', define new Up type and instance > - fclabels lenses now require wrapping with 'to' @@ -25,6 +24,7 @@ Description: PEZ is a generic zipper library. It uses lenses from the "f > - SavedPath renamed To > - removed experimental operators > - using failure package for exceptions + > - etc., etc. . @@ -43,7 +43,8 @@ Build-type: Simple -- Extra files to be distributed with the package, such as examples or -- a README. -Extra-source-files: EXAMPLES/Examples.lhs, PreludeLenses.hs +--Extra-source-files: EXAMPLES/Examples.lhs, PreludeLenses.hs +Extra-source-files: PreludeLenses.hs -- Constraint on the version of Cabal needed to build this package. Cabal-version: >=1.2.3