list-zipper 0.0.3 → 0.0.4
raw patch · 3 files changed
+345/−63 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.ListZipper: instance (Data.ListZipper.ListZipperOp x a Data.Type.Equality.~ t) => Control.Lens.Wrapped.Rewrapped (Data.ListZipper.ListZipperOp x' a') t
- Data.ListZipper: instance Control.Lens.Wrapped.Wrapped (Data.ListZipper.ListZipperOp x' a')
- Data.ListZipper: instance Control.Monad.Error.Class.MonadError () (Data.ListZipper.ListZipperOp x)
- Data.ListZipper: instance Control.Monad.Fail.MonadFail (Data.ListZipper.ListZipperOp x)
- Data.ListZipper: instance Control.Monad.Fix.MonadFix (Data.ListZipper.ListZipperOp x)
- Data.ListZipper: instance Control.Monad.Reader.Class.MonadReader (Data.ListZipper.ListZipper x) (Data.ListZipper.ListZipperOp x)
- Data.ListZipper: instance Control.Monad.State.Class.MonadState (Data.ListZipper.ListZipper x) (Data.ListZipper.ListZipperOp x)
- Data.ListZipper: instance Data.Functor.Alt.Alt (Data.ListZipper.ListZipperOp x)
- Data.ListZipper: instance Data.Functor.Bind.Class.Apply (Data.ListZipper.ListZipperOp x)
- Data.ListZipper: instance Data.Functor.Bind.Class.Bind (Data.ListZipper.ListZipperOp x)
- Data.ListZipper: instance GHC.Base.Applicative (Data.ListZipper.ListZipperOp x)
- Data.ListZipper: instance GHC.Base.Functor (Data.ListZipper.ListZipperOp x)
- Data.ListZipper: instance GHC.Base.Monad (Data.ListZipper.ListZipperOp x)
- Data.ListZipper: instance GHC.Base.MonadPlus (Data.ListZipper.ListZipperOp x)
- Data.ListZipper: instance GHC.Base.Monoid (Data.ListZipper.ListZipperOp x y)
- Data.ListZipper: instance GHC.Base.Semigroup (Data.ListZipper.ListZipperOp x y)
- Data.ListZipper: unListZipperOp' :: ListZipperOp' x -> ListZipper x -> Maybe (ListZipper x)
- Data.ListZipper: unpureListZipperOp :: ListZipperOp x a -> ListZipper x -> ListZipper x
+ Data.ListZipper: (##>) :: ListZipperOp a x -> ListZipper a -> Maybe (ListZipper a)
+ Data.ListZipper: ($$>) :: ListZipperOp a x -> ListZipper a -> [a]
+ Data.ListZipper: (%%>) :: ListZipperOp a x -> ListZipper a -> Maybe [a]
+ Data.ListZipper: (&&>) :: ListZipperOp a x -> ListZipper a -> Maybe x
+ Data.ListZipper: (*>>) :: (ListZipper a -> Maybe b) -> ListZipperOp a c -> ListZipperOp a b
+ Data.ListZipper: (.>>) :: (ListZipper a -> Maybe (ListZipper a)) -> ListZipperOp a b -> ListZipperOp' a
+ Data.ListZipper: (<##) :: ListZipper a -> ListZipperOp a x -> Maybe (ListZipper a)
+ Data.ListZipper: (<$$) :: ListZipper a -> ListZipperOp a x -> [a]
+ Data.ListZipper: (<%%) :: ListZipper a -> ListZipperOp a x -> Maybe [a]
+ Data.ListZipper: (<&&) :: ListZipper a -> ListZipperOp a x -> Maybe x
+ Data.ListZipper: (<<*) :: ListZipperOp a c -> (ListZipper a -> Maybe b) -> ListZipperOp a b
+ Data.ListZipper: (<<.) :: ListZipperOp a b -> (ListZipper a -> Maybe (ListZipper a)) -> ListZipperOp' a
+ Data.ListZipper: evalListZipperOp :: ListZipperOp a x -> ListZipper a -> Maybe x
+ Data.ListZipper: execListZipperOp :: ListZipperOp a x -> ListZipper a -> Maybe (ListZipper a)
+ Data.ListZipper: execOpList :: ListZipperOp a x -> ListZipper a -> Maybe [a]
+ Data.ListZipper: execOpList' :: ListZipperOp a x -> ListZipper a -> [a]
+ Data.ListZipper: getFocus :: ListZipperOp a a
+ Data.ListZipper: getLeftz :: ListZipperOp a [a]
+ Data.ListZipper: getList :: ListZipperOp a [a]
+ Data.ListZipper: getRightz :: ListZipperOp a [a]
+ Data.ListZipper: infixl 5 <$$
+ Data.ListZipper: infixl 6 <&&
+ Data.ListZipper: instance (Data.ListZipper.ListZipperOp a x Data.Type.Equality.~ t) => Control.Lens.Wrapped.Rewrapped (Data.ListZipper.ListZipperOp b' a') t
+ Data.ListZipper: instance Control.Lens.Wrapped.Wrapped (Data.ListZipper.ListZipperOp a' x')
+ Data.ListZipper: instance Control.Monad.Error.Class.MonadError () (Data.ListZipper.ListZipperOp a)
+ Data.ListZipper: instance Control.Monad.Fail.MonadFail (Data.ListZipper.ListZipperOp a)
+ Data.ListZipper: instance Control.Monad.Fix.MonadFix (Data.ListZipper.ListZipperOp a)
+ Data.ListZipper: instance Control.Monad.Reader.Class.MonadReader (Data.ListZipper.ListZipper a) (Data.ListZipper.ListZipperOp a)
+ Data.ListZipper: instance Control.Monad.State.Class.MonadState (Data.ListZipper.ListZipper a) (Data.ListZipper.ListZipperOp a)
+ Data.ListZipper: instance Data.Functor.Alt.Alt (Data.ListZipper.ListZipperOp a)
+ Data.ListZipper: instance Data.Functor.Bind.Class.Apply (Data.ListZipper.ListZipperOp a)
+ Data.ListZipper: instance Data.Functor.Bind.Class.Bind (Data.ListZipper.ListZipperOp a)
+ Data.ListZipper: instance GHC.Base.Applicative (Data.ListZipper.ListZipperOp a)
+ Data.ListZipper: instance GHC.Base.Functor (Data.ListZipper.ListZipperOp a)
+ Data.ListZipper: instance GHC.Base.Monad (Data.ListZipper.ListZipperOp a)
+ Data.ListZipper: instance GHC.Base.MonadPlus (Data.ListZipper.ListZipperOp a)
+ Data.ListZipper: instance GHC.Base.Monoid (Data.ListZipper.ListZipperOp a b)
+ Data.ListZipper: instance GHC.Base.Semigroup (Data.ListZipper.ListZipperOp a b)
+ Data.ListZipper: moveLeftRightUntilThen :: (a -> Bool) -> ListZipperOp' a
+ Data.ListZipper: moveLeftRightWith :: (a -> Maybe c) -> ListZipperOp a c
+ Data.ListZipper: moveLeftRightWithThen :: (a -> Maybe c) -> ListZipperOp a c
+ Data.ListZipper: moveLeftUntilThen :: (a -> Bool) -> ListZipperOp' a
+ Data.ListZipper: moveLeftWith :: (a -> Maybe c) -> ListZipperOp a c
+ Data.ListZipper: moveLeftWithThen :: (a -> Maybe c) -> ListZipperOp a c
+ Data.ListZipper: moveRightLeftUntilThen :: (a -> Bool) -> ListZipperOp' a
+ Data.ListZipper: moveRightLeftWith :: (a -> Maybe c) -> ListZipperOp a c
+ Data.ListZipper: moveRightLeftWithThen :: (a -> Maybe c) -> ListZipperOp a c
+ Data.ListZipper: moveRightUntilThen :: (a -> Bool) -> ListZipperOp' a
+ Data.ListZipper: moveRightWith :: (a -> Maybe c) -> ListZipperOp a c
+ Data.ListZipper: moveRightWithThen :: (a -> Maybe c) -> ListZipperOp a c
+ Data.ListZipper: opUntilThen :: ListZipperOp a x -> (a -> Bool) -> ListZipperOp' a
+ Data.ListZipper: opWith :: ListZipperOp a b -> (a -> Maybe c) -> ListZipperOp a c
+ Data.ListZipper: opWithThen :: ListZipperOp a b -> (a -> Maybe c) -> ListZipperOp a c
+ Data.ListZipper: runListZipperOp :: ListZipperOp a x -> ListZipper a -> Maybe (ListZipper a, x)
- Data.ListZipper: ListZipperOp :: (ListZipper x -> Maybe (ListZipper x, a)) -> ListZipperOp x a
+ Data.ListZipper: ListZipperOp :: (ListZipper a -> Maybe (ListZipper a, b)) -> ListZipperOp a b
- Data.ListZipper: mkListZipperOp :: (ListZipper x -> Maybe a) -> ListZipperOp x a
+ Data.ListZipper: mkListZipperOp :: (ListZipper a -> Maybe b) -> ListZipperOp a b
- Data.ListZipper: mkListZipperOp' :: (ListZipper x -> Maybe (ListZipper x)) -> ListZipperOp' x
+ Data.ListZipper: mkListZipperOp' :: (ListZipper a -> Maybe (ListZipper a)) -> ListZipperOp' a
- Data.ListZipper: newtype ListZipperOp x a
+ Data.ListZipper: newtype ListZipperOp a b
- Data.ListZipper: opUntil :: ListZipperOp x () -> (x -> Bool) -> ListZipperOp x ()
+ Data.ListZipper: opUntil :: ListZipperOp a x -> (a -> Bool) -> ListZipperOp' a
- Data.ListZipper: type ListZipperOp' x = ListZipperOp x ()
+ Data.ListZipper: type ListZipperOp' a = ListZipperOp a ()
Files
- changelog.md +4/−0
- list-zipper.cabal +1/−1
- src/Data/ListZipper.hs +340/−62
changelog.md view
@@ -1,3 +1,7 @@+0.0.4++* lots more functions+ 0.0.3 * remove profunctor
list-zipper.cabal view
@@ -1,5 +1,5 @@ name: list-zipper-version: 0.0.3+version: 0.0.4 license: BSD3 license-file: LICENCE author: Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
src/Data/ListZipper.hs view
@@ -30,28 +30,62 @@ , insertMoveRight , ListZipperOp(..) , ListZipperOp'-, unListZipperOp' , HasListZipperOp(..) , AsListZipperOp(..)-, unpureListZipperOp+, getFocus+, getRightz+, getLeftz+, getList , mkListZipperOp+, (*>>)+, (<<*) , mkListZipperOp'+, (.>>)+, (<<.)+, runListZipperOp+, execListZipperOp+, (##>)+, (<##)+, evalListZipperOp+, (&&>)+, (<&&)+, execOpList+, (%%>)+, (<%%)+, execOpList'+, ($$>)+, (<$$) , moveLeft , moveRight+, opWith+, moveLeftWith+, moveRightWith+, moveLeftRightWith+, moveRightLeftWith+, opWithThen+, moveLeftWithThen+, moveRightWithThen+, moveLeftRightWithThen+, moveRightLeftWithThen , opUntil , moveLeftUntil , moveRightUntil , moveLeftRightUntil , moveRightLeftUntil+, opUntilThen+, moveLeftUntilThen+, moveRightUntilThen+, moveLeftRightUntilThen+, moveRightLeftUntilThen , opWhileJust , deleteStepLeft , deleteStepRight ) where -import Control.Applicative(Applicative(pure, (<*>)), Alternative((<|>), empty))+import Control.Applicative(Applicative(pure, (<*>)), Alternative((<|>), empty), (<*)) import Control.Category((.), id) import Control.Comonad(Comonad(duplicate, extract))-import Control.Lens(Each(each), Reversing(reversing), Ixed(ix), Rewrapped, Wrapped(Unwrapped, _Wrapped'), IxValue, Index, Prism', Lens', Traversal', _Wrapped, (^.), iso, (&), _1)+import Control.Lens(Each(each), Reversing(reversing), Ixed(ix), Rewrapped, Wrapped(Unwrapped, _Wrapped'), IxValue, Index, Prism', Lens', Traversal', _Wrapped, (^.), iso, (&), _1, _2) import Control.Monad.Error.Class(MonadError(throwError, catchError)) import Control.Monad.Fail(MonadFail(fail)) import Control.Monad.Fix(MonadFix(mfix))@@ -65,6 +99,7 @@ import Data.Eq(Eq((==))) import Data.Eq.Deriving(deriveEq1) import Data.Foldable(Foldable(toList, foldMap))+import Data.Function(flip) import Data.Functor(Functor(fmap), (<$>)) import Data.Functor.Alt(Alt((<!>))) import Data.Functor.Apply(Apply((<.>)))@@ -165,7 +200,7 @@ let dup x = (x, x) unf m =- unfoldr (fmap dup . (unListZipperOp' m)) z+ unfoldr (fmap dup . (execListZipperOp m)) z in ListZipper (unf moveLeft) z (unf moveRight) instance Comonad ListZipper where@@ -338,13 +373,13 @@ ListZipper a -> ListZipper a moveLeftLoop z =- fromMaybe (moveEnd z) (unListZipperOp' moveLeft z)+ fromMaybe (moveEnd z) (execListZipperOp moveLeft z) moveRightLoop :: ListZipper a -> ListZipper a moveRightLoop z =- fromMaybe (moveStart z) (unListZipperOp' moveRight z)+ fromMaybe (moveStart z) (execListZipperOp moveRight z) insertMoveLeft :: a@@ -362,26 +397,19 @@ ---- -newtype ListZipperOp x a =- ListZipperOp (ListZipper x -> Maybe (ListZipper x, a))--type ListZipperOp' x =- ListZipperOp x ()+newtype ListZipperOp a b =+ ListZipperOp (ListZipper a -> Maybe (ListZipper a, b)) -unListZipperOp' ::- ListZipperOp' x- -> ListZipper x- -> Maybe (ListZipper x)-unListZipperOp' o z =- fmap (^. _1) (z & o ^. _Wrapped)+type ListZipperOp' a =+ ListZipperOp a () -instance ListZipperOp x a ~ t =>- Rewrapped (ListZipperOp x' a') t+instance ListZipperOp a x ~ t =>+ Rewrapped (ListZipperOp b' a') t -instance Wrapped (ListZipperOp x' a') where- type Unwrapped (ListZipperOp x' a') =- ListZipper x'- -> Maybe (ListZipper x', a')+instance Wrapped (ListZipperOp a' x') where+ type Unwrapped (ListZipperOp a' x') =+ ListZipper a'+ -> Maybe (ListZipper a', x') _Wrapped' = iso (\(ListZipperOp k) -> k) ListZipperOp @@ -400,11 +428,11 @@ _ListZipperOp = id -instance Functor (ListZipperOp x) where+instance Functor (ListZipperOp a) where fmap f (ListZipperOp k) = ListZipperOp (fmap (fmap f) . k) -instance Apply (ListZipperOp x) where+instance Apply (ListZipperOp a) where ListZipperOp j <.> ListZipperOp k = ListZipperOp (\z -> j z >>= \(z', f) ->@@ -412,20 +440,20 @@ pure (z'', f a) ) -instance Applicative (ListZipperOp x) where+instance Applicative (ListZipperOp a) where (<*>) = (<.>) pure a = ListZipperOp (\z -> pure (z, a)) -instance Bind (ListZipperOp x) where+instance Bind (ListZipperOp a) where ListZipperOp j >>- f = ListZipperOp (\z -> j z >>- \(z', a) -> z' & f a ^. _Wrapped ) -instance Alt (ListZipperOp x) where+instance Alt (ListZipperOp a) where ListZipperOp j <!> ListZipperOp k = ListZipperOp (\z -> j z <!> k z) @@ -435,29 +463,29 @@ empty = ListZipperOp (pure empty) -instance Monad (ListZipperOp x) where+instance Monad (ListZipperOp a) where (>>=) = (>>-) return = pure -instance MonadPlus (ListZipperOp x) where+instance MonadPlus (ListZipperOp a) where ListZipperOp j `mplus` ListZipperOp k = ListZipperOp (\z -> j z `mplus` k z) mzero = ListZipperOp (pure mzero) -instance Semigroup (ListZipperOp x y) where+instance Semigroup (ListZipperOp a b) where ListZipperOp j <> ListZipperOp k = ListZipperOp (\z -> j z <!> k z) -instance Monoid (ListZipperOp x y) where+instance Monoid (ListZipperOp a b) where mappend = (<>) mempty = ListZipperOp (pure Nothing) -instance MonadState (ListZipper x) (ListZipperOp x) where+instance MonadState (ListZipper a) (ListZipperOp a) where get = ListZipperOp (\z -> Just (z, z)) put z =@@ -465,7 +493,7 @@ state k = ListZipperOp (\z -> let (z', a) = k z in Just (a, z')) -instance MonadReader (ListZipper x) (ListZipperOp x) where+instance MonadReader (ListZipper a) (ListZipperOp a) where ask = ListZipperOp (\z -> Just (z, z)) local k (ListZipperOp o) =@@ -473,19 +501,19 @@ reader k = ListZipperOp (\z -> Just (z, k z)) -instance MonadFix (ListZipperOp x) where+instance MonadFix (ListZipperOp a) where mfix f = ListZipperOp (\z -> mfix (\ ~(_, a) -> z & f a ^. _Wrapped) ) -instance MonadFail (ListZipperOp x) where+instance MonadFail (ListZipperOp a) where fail s = ListZipperOp (\_ -> Fail.fail s ) -instance MonadError () (ListZipperOp x) where+instance MonadError () (ListZipperOp a) where throwError () = ListZipperOp (\_ -> Nothing) catchError (ListZipperOp k) f =@@ -493,30 +521,187 @@ k z <!> (z & f () ^. _Wrapped) ) -unpureListZipperOp ::- ListZipperOp x a- -> ListZipper x- -> ListZipper x-unpureListZipperOp (ListZipperOp x) z =- case x z of- Nothing ->- z- Just (z', _) ->- z'+getFocus ::+ ListZipperOp a a+getFocus =+ ListZipperOp (\z -> Just (z, z ^. focus)) +getRightz ::+ ListZipperOp a [a]+getRightz =+ ListZipperOp (\z -> Just (z, z ^. rightz))++getLeftz ::+ ListZipperOp a [a]+getLeftz =+ ListZipperOp (\z -> Just (z, z ^. leftz))++getList ::+ ListZipperOp a [a]+getList =+ ListZipperOp (\z -> Just (z, list z))+ mkListZipperOp :: - (ListZipper x -> Maybe a)- -> ListZipperOp x a+ (ListZipper a -> Maybe b)+ -> ListZipperOp a b mkListZipperOp f = ListZipperOp (\z -> (\a -> (z, a)) <$> f z ) +(*>>) :: + (ListZipper a -> Maybe b)+ -> ListZipperOp a c+ -> ListZipperOp a b+f *>> k =+ mkListZipperOp f <* k++infixl 5 *>>++(<<*) :: + ListZipperOp a c+ -> (ListZipper a -> Maybe b)+ -> ListZipperOp a b+(<<*) =+ flip (*>>)++infixl 5 <<*+ mkListZipperOp' ::- (ListZipper x -> Maybe (ListZipper x)) -> ListZipperOp' x+ (ListZipper a -> Maybe (ListZipper a))+ -> ListZipperOp' a mkListZipperOp' f = ListZipperOp (\s -> (\s' -> (s', ())) <$> f s) +(.>>) ::+ (ListZipper a -> Maybe (ListZipper a))+ -> ListZipperOp a b+ -> ListZipperOp' a+f .>> k =+ mkListZipperOp' f <* k++infixl 5 .>>++(<<.) ::+ ListZipperOp a b+ -> (ListZipper a -> Maybe (ListZipper a))+ -> ListZipperOp' a+(<<.) =+ flip (.>>)++infixl 5 <<.++runListZipperOp ::+ ListZipperOp a x+ -> ListZipper a+ -> Maybe (ListZipper a, x)+runListZipperOp (ListZipperOp o) z =+ o z++execListZipperOp ::+ ListZipperOp a x+ -> ListZipper a+ -> Maybe (ListZipper a)+execListZipperOp o =+ fmap (^. _1) . runListZipperOp o++(##>) ::+ ListZipperOp a x+ -> ListZipper a+ -> Maybe (ListZipper a)+(##>) =+ execListZipperOp++infixl 6 ##>++(<##) ::+ ListZipper a+ -> ListZipperOp a x+ -> Maybe (ListZipper a)+(<##) =+ flip (##>)++infixl 6 <##++evalListZipperOp ::+ ListZipperOp a x+ -> ListZipper a+ -> Maybe x+evalListZipperOp o =+ fmap (^. _2) . runListZipperOp o++(&&>) ::+ ListZipperOp a x+ -> ListZipper a+ -> Maybe x+(&&>) =+ evalListZipperOp++infixl 6 &&>++(<&&) ::+ ListZipper a+ -> ListZipperOp a x+ -> Maybe x+(<&&) =+ flip (&&>)++infixl 6 <&&++execOpList ::+ ListZipperOp a x+ -> ListZipper a+ -> Maybe [a]+execOpList o =+ fmap list . execListZipperOp o++(%%>) ::+ ListZipperOp a x+ -> ListZipper a+ -> Maybe [a]+(%%>) =+ execOpList++infixl 5 %%>++(<%%) ::+ ListZipper a+ -> ListZipperOp a x+ -> Maybe [a]+(<%%) =+ flip (%%>)++infixl 5 <%%++execOpList' ::+ ListZipperOp a x+ -> ListZipper a+ -> [a]+execOpList' o z =+ case execOpList o z of+ Nothing ->+ []+ Just x ->+ x++($$>) ::+ ListZipperOp a x+ -> ListZipper a+ -> [a]+($$>) =+ execOpList'++infixl 5 $$>++(<$$) ::+ ListZipper a+ -> ListZipperOp a x+ -> [a]+(<$$) =+ flip ($$>)++infixl 5 <$$+ moveLeft :: ListZipperOp' a moveLeft =@@ -539,22 +724,84 @@ Just (ListZipper (x:l) h t) ) -opUntil ::- ListZipperOp x ()- -> (x -> Bool)- -> ListZipperOp x ()-opUntil o p =+opWith ::+ ListZipperOp a b+ -> (a -> Maybe c)+ -> ListZipperOp a c+opWith o p = ListZipperOp (\z -> let go z' = let x = z' ^. focus- in if p x- then- Just (z', ())- else- go =<< unListZipperOp' o z'+ in case p x of+ Nothing ->+ go =<< execListZipperOp o z'+ Just w ->+ Just (z', w) in go z ) +moveLeftWith ::+ (a -> Maybe c)+ -> ListZipperOp a c+moveLeftWith =+ opWith moveLeft++moveRightWith ::+ (a -> Maybe c)+ -> ListZipperOp a c+moveRightWith =+ opWith moveRight++moveLeftRightWith ::+ (a -> Maybe c)+ -> ListZipperOp a c+moveLeftRightWith p =+ moveLeftWith p <!> moveRightWith p++moveRightLeftWith ::+ (a -> Maybe c)+ -> ListZipperOp a c+moveRightLeftWith p =+ moveRightWith p <!> moveLeftWith p++opWithThen ::+ ListZipperOp a b+ -> (a -> Maybe c)+ -> ListZipperOp a c+opWithThen o p =+ opWith o p <* o++moveLeftWithThen ::+ (a -> Maybe c)+ -> ListZipperOp a c+moveLeftWithThen =+ opWithThen moveLeft++moveRightWithThen ::+ (a -> Maybe c)+ -> ListZipperOp a c+moveRightWithThen =+ opWithThen moveRight++moveLeftRightWithThen ::+ (a -> Maybe c)+ -> ListZipperOp a c+moveLeftRightWithThen p =+ moveLeftWithThen p <!> moveRightWithThen p++moveRightLeftWithThen ::+ (a -> Maybe c)+ -> ListZipperOp a c+moveRightLeftWithThen p =+ moveRightWithThen p <!> moveLeftWithThen p++opUntil ::+ ListZipperOp a x+ -> (a -> Bool)+ -> ListZipperOp' a+opUntil o p =+ opWith o (\a -> if p a then Just () else Nothing)+ moveLeftUntil :: (a -> Bool) -> ListZipperOp' a@@ -579,12 +826,43 @@ moveRightLeftUntil p = moveRightUntil p <!> moveLeftUntil p +opUntilThen ::+ ListZipperOp a x+ -> (a -> Bool)+ -> ListZipperOp' a+opUntilThen o p =+ opUntil o p <* o++moveLeftUntilThen ::+ (a -> Bool)+ -> ListZipperOp' a+moveLeftUntilThen =+ opUntilThen moveLeft++moveRightUntilThen ::+ (a -> Bool)+ -> ListZipperOp' a+moveRightUntilThen =+ opUntilThen moveRight++moveLeftRightUntilThen ::+ (a -> Bool)+ -> ListZipperOp' a+moveLeftRightUntilThen p =+ moveLeftUntilThen p <!> moveRightUntilThen p++moveRightLeftUntilThen ::+ (a -> Bool)+ -> ListZipperOp' a+moveRightLeftUntilThen p =+ moveRightUntilThen p <!> moveLeftUntilThen p+ opWhileJust :: ListZipperOp' a -> ListZipper a -> ListZipper a opWhileJust o z =- case unListZipperOp' o z of+ case execListZipperOp o z of Nothing -> z Just z' ->