HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduledata-clist-0.2Haskell2010

Data.CircularList.Internal

  • 1 type
  • 38 values
  • 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
valuefromList :: [a] -> CList a
#

Make a (balanced) CList from a list.

valueupdate :: a -> CList a -> CList a
#

Replaces the current focus with a new focus.

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.

valuetoList :: CList a -> [a]
#

Make a list from a CList.

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.

valuerotL :: CList a -> CList a
#

Rotate the focus to the previous (left) element.

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.

valuerotR :: CList a -> CList a
#

Rotate the focus to the next (right) element.

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.

valuefilterCL :: (CList a -> CList a) -> (a -> Bool) -> CList a -> CList a
#

Abstract away what to do with the focused element if it doesn't match the predicate when filtering.

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.

valuefoldrCL :: (CList a -> [a]) -> (a -> b -> b) -> b -> CList a -> b
#

Abstract away direction for a foldr.

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.

valuefoldlCL :: (CList b -> [b]) -> (a -> b -> a) -> a -> CList b -> a
#

Abstract away direction for a foldl'.

valuebalance :: CList a -> CList a
#

Balance the CList. Equivalent to `fromList . toList`

valuepackL :: CList a -> CList a
#

Move all elements to the left side of the CList.

valuepackR :: CList a -> CList a
#

Move all elements to the right side of the CList.