Agda-2.8.0: A dependently typed functional programming language and proof assistant

Safe Haskell | None
Language | Haskell2010

Agda.Utils.Zipper

# Documentation

class Zipper z where Source #

Associated Types

type Carrier z Source #

type Element z Source #

Methods

firstHole :: Carrier z -> Maybe (Element z, z) Source #

plugHole :: Element z -> z -> Carrier z Source #

nextHole :: Element z -> z -> Either (Carrier z) (Element z, z) Source #

#### Instances

Instances details

Zipper (ListZipper a) Source # |

Instance details

Defined in Agda.Utils.Zipper

Associated Types

type Carrier (ListZipper a) |
Instance details Defined in Agda.Utils.Zipper type Carrier (ListZipper a) = [a]
type Element (ListZipper a) |
Instance details Defined in Agda.Utils.Zipper type Element (ListZipper a) = a

Methods

firstHole :: Carrier (ListZipper a) -> Maybe (Element (ListZipper a), ListZipper a) Source #

plugHole :: Element (ListZipper a) -> ListZipper a -> Carrier (ListZipper a) Source #

nextHole :: Element (ListZipper a) -> ListZipper a -> Either (Carrier (ListZipper a)) (Element (ListZipper a), ListZipper a) Source #

(Zipper f, Zipper g, Element f ~ Carrier g) => Zipper (ComposeZipper f g) Source # |

Instance details

Defined in Agda.Utils.Zipper

Associated Types

type Carrier (ComposeZipper f g) |
Instance details Defined in Agda.Utils.Zipper type Carrier (ComposeZipper f g) = Carrier f
type Element (ComposeZipper f g) |
Instance details Defined in Agda.Utils.Zipper type Element (ComposeZipper f g) = Element g

Methods

firstHole :: Carrier (ComposeZipper f g) -> Maybe (Element (ComposeZipper f g), ComposeZipper f g) Source #

plugHole :: Element (ComposeZipper f g) -> ComposeZipper f g -> Carrier (ComposeZipper f g) Source #

nextHole :: Element (ComposeZipper f g) -> ComposeZipper f g -> Either (Carrier (ComposeZipper f g)) (Element (ComposeZipper f g), ComposeZipper f g) Source #

data ListZipper a Source #

Constructors

ListZip [a] [a] |

#### Instances

Instances details

Functor ListZipper Source # |
Instance details Defined in Agda.Utils.Zipper Methods fmap :: (a -> b) -> ListZipper a -> ListZipper b Source # (<$) :: a -> ListZipper b -> ListZipper a Source #
Foldable ListZipper Source # |

Instance details

Defined in Agda.Utils.Zipper

Methods

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

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

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

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

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

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

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

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

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

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

null :: ListZipper a -> Bool Source #

length :: ListZipper a -> Int Source #

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

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

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

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

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

Traversable ListZipper Source # |
Instance details Defined in Agda.Utils.Zipper Methods traverse :: Applicative f => (a -> f b) -> ListZipper a -> f (ListZipper b) Source # sequenceA :: Applicative f => ListZipper (f a) -> f (ListZipper a) Source # mapM :: Monad m => (a -> m b) -> ListZipper a -> m (ListZipper b) Source # sequence :: Monad m => ListZipper (m a) -> m (ListZipper a) Source #
Zipper (ListZipper a) Source # |

Instance details

Defined in Agda.Utils.Zipper

Associated Types

type Carrier (ListZipper a) |
Instance details Defined in Agda.Utils.Zipper type Carrier (ListZipper a) = [a]
type Element (ListZipper a) |
Instance details Defined in Agda.Utils.Zipper type Element (ListZipper a) = a

Methods

firstHole :: Carrier (ListZipper a) -> Maybe (Element (ListZipper a), ListZipper a) Source #

plugHole :: Element (ListZipper a) -> ListZipper a -> Carrier (ListZipper a) Source #

nextHole :: Element (ListZipper a) -> ListZipper a -> Either (Carrier (ListZipper a)) (Element (ListZipper a), ListZipper a) Source #

Show a => Show (ListZipper a) Source # |
Instance details Defined in Agda.Utils.Zipper Methods showsPrec :: Int -> ListZipper a -> ShowS Source # show :: ListZipper a -> String Source # showList :: [ListZipper a] -> ShowS Source #
Eq a => Eq (ListZipper a) Source # |
Instance details Defined in Agda.Utils.Zipper Methods (==) :: ListZipper a -> ListZipper a -> Bool Source # (/=) :: ListZipper a -> ListZipper a -> Bool Source #
Ord a => Ord (ListZipper a) Source # |

Instance details

Defined in Agda.Utils.Zipper

Methods

compare :: ListZipper a -> ListZipper a -> Ordering Source #

(<) :: ListZipper a -> ListZipper a -> Bool Source #

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

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

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

max :: ListZipper a -> ListZipper a -> ListZipper a Source #

min :: ListZipper a -> ListZipper a -> ListZipper a Source #

type Carrier (ListZipper a) Source # |
Instance details Defined in Agda.Utils.Zipper type Carrier (ListZipper a) = [a]
type Element (ListZipper a) Source # |
Instance details Defined in Agda.Utils.Zipper type Element (ListZipper a) = a

data ComposeZipper f g Source #

Constructors

ComposeZip f g |

#### Instances

Instances details

(Zipper f, Zipper g, Element f ~ Carrier g) => Zipper (ComposeZipper f g) Source # |

Instance details

Defined in Agda.Utils.Zipper

Associated Types

type Carrier (ComposeZipper f g) |
Instance details Defined in Agda.Utils.Zipper type Carrier (ComposeZipper f g) = Carrier f
type Element (ComposeZipper f g) |
Instance details Defined in Agda.Utils.Zipper type Element (ComposeZipper f g) = Element g

Methods

firstHole :: Carrier (ComposeZipper f g) -> Maybe (Element (ComposeZipper f g), ComposeZipper f g) Source #

plugHole :: Element (ComposeZipper f g) -> ComposeZipper f g -> Carrier (ComposeZipper f g) Source #

nextHole :: Element (ComposeZipper f g) -> ComposeZipper f g -> Either (Carrier (ComposeZipper f g)) (Element (ComposeZipper f g), ComposeZipper f g) Source #

type Carrier (ComposeZipper f g) Source # |
Instance details Defined in Agda.Utils.Zipper type Carrier (ComposeZipper f g) = Carrier f
type Element (ComposeZipper f g) Source # |
Instance details Defined in Agda.Utils.Zipper type Element (ComposeZipper f g) = Element g