data-carousel-0.1.0.0: A rotating sequence data structure

CopyrightCopyright © 2014 AlephCloud Systems, Inc.
LicenseMIT
MaintainerJon Sterling <jsterling@alephcloud.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Carousel

Description

 

Synopsis

Documentation

empty :: Carousel α Source

The empty carousel.

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)

append :: [α] -> Carousel α -> Carousel α Source

Append a list of elements to the right side of the carousel.

clSequence :: Iso (Carousel α) (Carousel β) (Seq α) (Seq β) Source

clList :: Iso (Carousel α) (Carousel β) [α] [β] Source