Skip to content

Commit

Permalink
remove outdated examples from cabal file, change repeatMove to moveFloor
Browse files Browse the repository at this point in the history
  • Loading branch information
jberryman committed Jan 27, 2012
1 parent a05c887 commit 19f98db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
12 changes: 5 additions & 7 deletions Data/Label/Zipper.hs
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Tests.hs
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions pez.cabal
Expand Up @@ -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'
Expand All @@ -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.
.


Expand All @@ -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
Expand Down

0 comments on commit 19f98db

Please sign in to comment.