list-zipper-0.0.8: A list zipper

Safe HaskellNone
LanguageHaskell2010

Data.ListZipper

Contents

Synopsis

data types

data ListZipper a Source #

Constructors

ListZipper [a] a [a] 
Instances
Functor ListZipper Source # 
Instance details

Defined in Data.ListZipper

Methods

fmap :: (a -> b) -> ListZipper a -> ListZipper b #

(<$) :: a -> ListZipper b -> ListZipper a #

Applicative ListZipper Source # 
Instance details

Defined in Data.ListZipper

Methods

pure :: a -> ListZipper a #

(<*>) :: ListZipper (a -> b) -> ListZipper a -> ListZipper b #

liftA2 :: (a -> b -> c) -> ListZipper a -> ListZipper b -> ListZipper c #

(*>) :: ListZipper a -> ListZipper b -> ListZipper b #

(<*) :: ListZipper a -> ListZipper b -> ListZipper a #

Foldable ListZipper Source # 
Instance details

Defined in Data.ListZipper

Methods

fold :: Monoid m => ListZipper m -> m #

foldMap :: Monoid m => (a -> m) -> ListZipper a -> m #

foldr :: (a -> b -> b) -> b -> ListZipper a -> b #

foldr' :: (a -> b -> b) -> b -> ListZipper a -> b #

foldl :: (b -> a -> b) -> b -> ListZipper a -> b #

foldl' :: (b -> a -> b) -> b -> ListZipper a -> b #

foldr1 :: (a -> a -> a) -> ListZipper a -> a #

foldl1 :: (a -> a -> a) -> ListZipper a -> a #

toList :: ListZipper a -> [a] #

null :: ListZipper a -> Bool #

length :: ListZipper a -> Int #

elem :: Eq a => a -> ListZipper a -> Bool #

maximum :: Ord a => ListZipper a -> a #

minimum :: Ord a => ListZipper a -> a #

sum :: Num a => ListZipper a -> a #

product :: Num a => ListZipper a -> a #

Traversable ListZipper Source # 
Instance details

Defined in Data.ListZipper

Methods

traverse :: Applicative f => (a -> f b) -> ListZipper a -> f (ListZipper b) #

sequenceA :: Applicative f => ListZipper (f a) -> f (ListZipper a) #

mapM :: Monad m => (a -> m b) -> ListZipper a -> m (ListZipper b) #

sequence :: Monad m => ListZipper (m a) -> m (ListZipper a) #

Eq1 ListZipper Source # 
Instance details

Defined in Data.ListZipper

Methods

liftEq :: (a -> b -> Bool) -> ListZipper a -> ListZipper b -> Bool #

Show1 ListZipper Source # 
Instance details

Defined in Data.ListZipper

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> ListZipper a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [ListZipper a] -> ShowS #

Comonad ListZipper Source # 
Instance details

Defined in Data.ListZipper

Apply ListZipper Source # 
Instance details

Defined in Data.ListZipper

Methods

(<.>) :: ListZipper (a -> b) -> ListZipper a -> ListZipper b #

(.>) :: ListZipper a -> ListZipper b -> ListZipper b #

(<.) :: ListZipper a -> ListZipper b -> ListZipper a #

liftF2 :: (a -> b -> c) -> ListZipper a -> ListZipper b -> ListZipper c #

Traversable1 ListZipper Source # 
Instance details

Defined in Data.ListZipper

Methods

traverse1 :: Apply f => (a -> f b) -> ListZipper a -> f (ListZipper b) #

sequence1 :: Apply f => ListZipper (f b) -> f (ListZipper b) #

Foldable1 ListZipper Source # 
Instance details

Defined in Data.ListZipper

Methods

fold1 :: Semigroup m => ListZipper m -> m #

foldMap1 :: Semigroup m => (a -> m) -> ListZipper a -> m #

toNonEmpty :: ListZipper a -> NonEmpty a #

Extend ListZipper Source # 
Instance details

Defined in Data.ListZipper

Eq a => Eq (ListZipper a) Source # 
Instance details

Defined in Data.ListZipper

Methods

(==) :: ListZipper a -> ListZipper a -> Bool #

(/=) :: ListZipper a -> ListZipper a -> Bool #

Ord a => Ord (ListZipper a) Source # 
Instance details

Defined in Data.ListZipper

Show a => Show (ListZipper a) Source # 
Instance details

Defined in Data.ListZipper

Semigroup a => Semigroup (ListZipper a) Source # 
Instance details

Defined in Data.ListZipper

Ixed (ListZipper a) Source # 
Instance details

Defined in Data.ListZipper

Reversing (ListZipper a) Source # 
Instance details

Defined in Data.ListZipper

Methods

reversing :: ListZipper a -> ListZipper a #

HasListZipper (ListZipper a) a Source # 
Instance details

Defined in Data.ListZipper

AsListZipper (ListZipper a) a Source # 
Instance details

Defined in Data.ListZipper

MonadReader (ListZipper a) (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Methods

ask :: ListZipperOp a (ListZipper a) #

local :: (ListZipper a -> ListZipper a) -> ListZipperOp a a0 -> ListZipperOp a a0 #

reader :: (ListZipper a -> a0) -> ListZipperOp a a0 #

MonadState (ListZipper a) (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Methods

get :: ListZipperOp a (ListZipper a) #

put :: ListZipper a -> ListZipperOp a () #

state :: (ListZipper a -> (a0, ListZipper a)) -> ListZipperOp a a0 #

Each (ListZipper a) (ListZipper a) a a Source # 
Instance details

Defined in Data.ListZipper

Methods

each :: Traversal (ListZipper a) (ListZipper a) a a #

type Index (ListZipper a) Source # 
Instance details

Defined in Data.ListZipper

type Index (ListZipper a) = Int
type IxValue (ListZipper a) Source # 
Instance details

Defined in Data.ListZipper

type IxValue (ListZipper a) = a

newtype ListZipperOp a b Source #

Constructors

ListZipperOp (ListZipper a -> Maybe (ListZipper a, b)) 
Instances
MonadError () (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Methods

throwError :: () -> ListZipperOp a a0 #

catchError :: ListZipperOp a a0 -> (() -> ListZipperOp a a0) -> ListZipperOp a a0 #

Monad (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Methods

(>>=) :: ListZipperOp a a0 -> (a0 -> ListZipperOp a b) -> ListZipperOp a b #

(>>) :: ListZipperOp a a0 -> ListZipperOp a b -> ListZipperOp a b #

return :: a0 -> ListZipperOp a a0 #

fail :: String -> ListZipperOp a a0 #

Functor (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Methods

fmap :: (a0 -> b) -> ListZipperOp a a0 -> ListZipperOp a b #

(<$) :: a0 -> ListZipperOp a b -> ListZipperOp a a0 #

MonadFix (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Methods

mfix :: (a0 -> ListZipperOp a a0) -> ListZipperOp a a0 #

MonadFail (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Methods

fail :: String -> ListZipperOp a a0 #

Applicative (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Methods

pure :: a0 -> ListZipperOp a a0 #

(<*>) :: ListZipperOp a (a0 -> b) -> ListZipperOp a a0 -> ListZipperOp a b #

liftA2 :: (a0 -> b -> c) -> ListZipperOp a a0 -> ListZipperOp a b -> ListZipperOp a c #

(*>) :: ListZipperOp a a0 -> ListZipperOp a b -> ListZipperOp a b #

(<*) :: ListZipperOp a a0 -> ListZipperOp a b -> ListZipperOp a a0 #

Alternative (ListZipperOp x) Source # 
Instance details

Defined in Data.ListZipper

Methods

empty :: ListZipperOp x a #

(<|>) :: ListZipperOp x a -> ListZipperOp x a -> ListZipperOp x a #

some :: ListZipperOp x a -> ListZipperOp x [a] #

many :: ListZipperOp x a -> ListZipperOp x [a] #

MonadPlus (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Methods

mzero :: ListZipperOp a a0 #

mplus :: ListZipperOp a a0 -> ListZipperOp a a0 -> ListZipperOp a a0 #

Apply (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Methods

(<.>) :: ListZipperOp a (a0 -> b) -> ListZipperOp a a0 -> ListZipperOp a b #

(.>) :: ListZipperOp a a0 -> ListZipperOp a b -> ListZipperOp a b #

(<.) :: ListZipperOp a a0 -> ListZipperOp a b -> ListZipperOp a a0 #

liftF2 :: (a0 -> b -> c) -> ListZipperOp a a0 -> ListZipperOp a b -> ListZipperOp a c #

Alt (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Bind (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Methods

(>>-) :: ListZipperOp a a0 -> (a0 -> ListZipperOp a b) -> ListZipperOp a b #

join :: ListZipperOp a (ListZipperOp a a0) -> ListZipperOp a a0 #

MonadReader (ListZipper a) (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Methods

ask :: ListZipperOp a (ListZipper a) #

local :: (ListZipper a -> ListZipper a) -> ListZipperOp a a0 -> ListZipperOp a a0 #

reader :: (ListZipper a -> a0) -> ListZipperOp a a0 #

MonadState (ListZipper a) (ListZipperOp a) Source # 
Instance details

Defined in Data.ListZipper

Methods

get :: ListZipperOp a (ListZipper a) #

put :: ListZipper a -> ListZipperOp a () #

state :: (ListZipper a -> (a0, ListZipper a)) -> ListZipperOp a a0 #

Semigroup (ListZipperOp a b) Source # 
Instance details

Defined in Data.ListZipper

Methods

(<>) :: ListZipperOp a b -> ListZipperOp a b -> ListZipperOp a b #

sconcat :: NonEmpty (ListZipperOp a b) -> ListZipperOp a b #

stimes :: Integral b0 => b0 -> ListZipperOp a b -> ListZipperOp a b #

Monoid (ListZipperOp a b) Source # 
Instance details

Defined in Data.ListZipper

Wrapped (ListZipperOp a' x') Source # 
Instance details

Defined in Data.ListZipper

Associated Types

type Unwrapped (ListZipperOp a' x') :: Type #

Methods

_Wrapped' :: Iso' (ListZipperOp a' x') (Unwrapped (ListZipperOp a' x')) #

ListZipperOp a x ~ t => Rewrapped (ListZipperOp b' a') t Source # 
Instance details

Defined in Data.ListZipper

AsListZipperOp (ListZipperOp x y) x y Source # 
Instance details

Defined in Data.ListZipper

HasListZipperOp (ListZipperOp x y) x y Source # 
Instance details

Defined in Data.ListZipper

Methods

lo :: Lens' (ListZipperOp x y) (ListZipperOp x y) Source #

type Unwrapped (ListZipperOp a' x') Source # 
Instance details

Defined in Data.ListZipper

type Unwrapped (ListZipperOp a' x') = ListZipper a' -> Maybe (ListZipper a', x')

lenses and prisms

class AsListZipper z a | z -> a where Source #

Instances
AsListZipper (ListZipper a) a Source # 
Instance details

Defined in Data.ListZipper

class HasListZipper z a | z -> a where Source #

Minimal complete definition

listZipper

Instances
HasListZipper (ListZipper a) a Source # 
Instance details

Defined in Data.ListZipper

class HasListZipperOp lo x y | lo -> x y where Source #

Methods

lo :: Lens' lo (ListZipperOp x y) Source #

Instances
HasListZipperOp (ListZipperOp x y) x y Source # 
Instance details

Defined in Data.ListZipper

Methods

lo :: Lens' (ListZipperOp x y) (ListZipperOp x y) Source #

class AsListZipperOp t x y | t -> x y where Source #

Instances
AsListZipperOp (ListZipperOp x y) x y Source # 
Instance details

Defined in Data.ListZipper

traversals

make zippers

zipper0L :: a -> [a] -> ListZipper a Source #

zipper0R :: [a] -> a -> ListZipper a Source #

rezip

list :: ListZipper a -> [a] Source #

indices

transform

movement

opWith :: ListZipperOp a b -> (a -> Maybe c) -> ListZipperOp a c Source #

opWithThen :: ListZipperOp a b -> (a -> Maybe c) -> ListZipperOp a c Source #

insertion

deletion

modifcation

modifyFocus :: (a -> a) -> ListZipperOp a a Source #

focus position

get context

list zipper state operations

(<$~) :: ListZipperOp a b -> ListZipperOp a c -> ListZipperOp a b infixl 5 Source #

(*>>) :: (ListZipper a -> Maybe b) -> ListZipperOp a c -> ListZipperOp a b infixl 5 Source #

(<<*) :: ListZipperOp a c -> (ListZipper a -> Maybe b) -> ListZipperOp a b infixl 5 Source #

(.>>) :: (ListZipper a -> Maybe (ListZipper a)) -> ListZipperOp a b -> ListZipperOp' a infixl 5 Source #

(<<.) :: ListZipperOp a b -> (ListZipper a -> Maybe (ListZipper a)) -> ListZipperOp' a infixl 5 Source #

(##>) :: ListZipperOp a x -> ListZipper a -> Maybe (ListZipper a) infixl 6 Source #

(<##) :: ListZipper a -> ListZipperOp a x -> Maybe (ListZipper a) infixl 6 Source #

(&&>) :: ListZipperOp a x -> ListZipper a -> Maybe x infixl 6 Source #

(<&&) :: ListZipper a -> ListZipperOp a x -> Maybe x infixl 6 Source #

(%%>) :: ListZipperOp a x -> ListZipper a -> Maybe [a] infixl 5 Source #

(<%%) :: ListZipper a -> ListZipperOp a x -> Maybe [a] infixl 5 Source #

($$>) :: ListZipperOp a x -> ListZipper a -> [a] infixl 5 Source #

(<$$) :: ListZipper a -> ListZipperOp a x -> [a] infixl 5 Source #