list-zipper 0.0.7 → 0.0.8
raw patch · 3 files changed
+31/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.ListZipper: (<$~) :: ListZipperOp a b -> ListZipperOp a c -> ListZipperOp a b
+ Data.ListZipper: rev :: ListZipper a -> ListZipper a
Files
- changelog.md +4/−0
- list-zipper.cabal +1/−1
- src/Data/ListZipper.hs +26/−1
changelog.md view
@@ -1,3 +1,7 @@+0.0.8++* add `rev` function to reverse+ 0.0.7 * haddock for function categories
list-zipper.cabal view
@@ -1,5 +1,5 @@ name: list-zipper-version: 0.0.7+version: 0.0.8 license: BSD3 license-file: LICENCE author: Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
src/Data/ListZipper.hs view
@@ -30,6 +30,8 @@ , list -- * indices , zipperIndices+-- * transform+, rev -- * movement , moveLeft , moveRight@@ -79,6 +81,7 @@ -- * list zipper state operations , liftListZipperOp , mkListZipperOp+, (<$~) , (*>>) , (<<*) , mkListZipperOp'@@ -118,7 +121,7 @@ import Data.Eq.Deriving(deriveEq1) import Data.Foldable(Foldable(toList, foldMap)) import Data.Function(flip)-import Data.Functor(Functor(fmap), (<$>))+import Data.Functor(Functor(fmap), (<$>), (<$)) import Data.Functor.Alt(Alt((<!>))) import Data.Functor.Apply(Apply((<.>))) import Data.Functor.Bind(Bind((>>-)))@@ -361,6 +364,12 @@ (ln, x) (zip [ln + 1..] r) +rev ::+ ListZipper a+ -> ListZipper a+rev (ListZipper l x r) =+ ListZipper r x l+ moveStart :: ListZipper a -> ListZipper a@@ -592,6 +601,22 @@ -> ListZipperOp a b mkListZipperOp f = get >>= liftListZipperOp . f++(<$~) ::+ ListZipperOp a b+ -> ListZipperOp a c+ -> ListZipperOp a b+ListZipperOp x <$~ ListZipperOp y =+ ListZipperOp+ (\z ->+ case x z of+ Nothing ->+ Nothing+ Just (z', r) ->+ fmap (r <$) (y z')+ )++infixl 5 <$~ (*>>) :: (ListZipper a -> Maybe b)