HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Moduledata-clist-0.2Haskell2010

Data.CircularList.Internal

Synopsis
  • Packagedata-clist-0.2
  • Exports39
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceInternal.hs
datadata CList a

A functional ring type.

Constructors

Instances7Functor, Foldable, Traversable, Eq, Read, Show, …
  • Functor CListDefined in data-clist-0.2 · Data.CircularList.Internal
  • Foldable CListDefined in data-clist-0.2 · Data.CircularList.Internal
  • Traversable CListDefined in data-clist-0.2 · Data.CircularList.Internal
  • Eq a => Eq (CList a)Defined in data-clist-0.2 · Data.CircularList.Internal
  • Read a => Read (CList a)Defined in data-clist-0.2 · Data.CircularList.Internal
  • Show a => Show (CList a)Defined in data-clist-0.2 · Data.CircularList.Internal
  • NFData a => NFData (CList a)Defined in data-clist-0.2 · Data.CircularList.Internal
valueleftElements :: CList a -> [a]

Starting with the focus, go left and accumulate all elements of the CList in a list.

valuerightElements :: CList a -> [a]

Starting with the focus, go right and accumulate all elements of the CList in a list.

valueinsertR :: a -> CList a -> CList a

Insert an element into the CList as the new focus. The old focus is now the next element to the right.

valueinsertL :: a -> CList a -> CList a

Insert an element into the CList as the new focus. The old focus is now the next element to the left.

valueremoveL :: CList a -> CList a

Remove the focus from the CList. The new focus is the next element to the left.

valuemRotL :: CList a -> Maybe (CList a)

A non-cyclic version of rotL; that is, only rotate the focus if there is a previous (left) element to rotate to.

valuemRotR :: CList a -> Maybe (CList a)

A non-cyclic version of rotL; that is, only rotate the focus if there is a previous (left) element to rotate to.

valuerotN :: Int -> CList a -> CList a

Rotate the focus the specified number of times; if the index is positive then it is rotated to the right; otherwise it is rotated to the left.

valuerotNL :: Int -> CList a -> CList a

Rotate the focus the specified number of times to the left (but don't rotate if n <= 0).

valuefilterR :: (a -> Bool) -> CList a -> CList a

Remove those elements that do not satisfy the supplied predicate, rotating to the right if the focus does not satisfy the predicate.

valuefoldrR :: (a -> b -> b) -> b -> CList a -> b

A right-fold, rotating to the right through the CList.

valuefoldrL :: (a -> b -> b) -> b -> CList a -> b

A right-fold, rotating to the left through the CList.

valuefoldlR :: (a -> b -> a) -> a -> CList b -> a

A (strict) left-fold, rotating to the right through the CList.

valuefoldlL :: (a -> b -> a) -> a -> CList b -> a

A (strict) left-fold, rotating to the left through the CList.