Copyright | Copyright © 2014 AlephCloud Systems, Inc. |
---|---|
License | MIT |
Maintainer | Jon Sterling <jsterling@alephcloud.com> |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- data Carousel α
- empty :: Carousel α
- cursor :: Traversal' (Carousel α) α
- moveLeft :: Carousel α -> Carousel α
- moveRight :: Carousel α -> Carousel α
- dropCursor :: Carousel α -> Carousel α
- nub :: Eq α => Carousel α -> Carousel α
- append :: [α] -> Carousel α -> Carousel α
- clSequence :: Iso (Carousel α) (Carousel β) (Seq α) (Seq β)
- clList :: Iso (Carousel α) (Carousel β) [α] [β]
Documentation
cursor :: Traversal' (Carousel α) α Source
There is guaranteed to be a cursor so long as the carousel is non-empty.
moveLeft :: Carousel α -> Carousel α Source
The carousel may be rotated to the left; this operation is written so as to always guarantee the presence of a cursor in a non-empty carousel.
moveRight :: Carousel α -> Carousel α Source
The carousel may be rotated to the right; this operation is written so as to always guarantee the presence of a cursor in a non-empty carousel.
dropCursor :: Carousel α -> Carousel α Source
You can delete the cursor from the carousel; the items to its right will move one over to the left.
nub :: Eq α => Carousel α -> Carousel α Source
Remove all duplicate elements from the carousel. (TODO: this is inefficient)