Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | GHC2021 |
Representing Cyclic Sequences
Synopsis
- newtype Cyclic (v :: k -> Type) (a :: k) = Cyclic (v a)
- class HasDirectedTraversals (v :: Type -> Type) where
- traverseRightFrom :: Index (v a) -> IndexedTraversal1' (Index (v a)) (v a) a
- traverseLeftFrom :: Index (v a) -> IndexedTraversal1' (Index (v a)) (v a) a
- class ShiftedEq t where
- type ElemCyclic t
- isShiftOf :: t -> t -> Bool
Documentation
newtype Cyclic (v :: k -> Type) (a :: k) Source #
A cyclic sequence type
Cyclic (v a) |
Instances
class HasDirectedTraversals (v :: Type -> Type) where Source #
Class that models that some type has a cyclic traversal starting from a particular index.
traverseRightFrom :: Index (v a) -> IndexedTraversal1' (Index (v a)) (v a) a Source #
A rightward-traversal over all elements starting from the given one.
running time : \(O(n)\)
traverseLeftFrom :: Index (v a) -> IndexedTraversal1' (Index (v a)) (v a) a Source #
A rightward-traversal over all elements starting from the given one.
running time : \(O(n)\)
Instances
HasDirectedTraversals ViewL1 Source # | |
Defined in HGeometry.Cyclic traverseRightFrom :: Index (ViewL1 a) -> IndexedTraversal1' (Index (ViewL1 a)) (ViewL1 a) a Source # traverseLeftFrom :: Index (ViewL1 a) -> IndexedTraversal1' (Index (ViewL1 a)) (ViewL1 a) a Source # | |
HasDirectedTraversals NonEmptyVector Source # | |
Defined in HGeometry.Cyclic traverseRightFrom :: Index (NonEmptyVector a) -> IndexedTraversal1' (Index (NonEmptyVector a)) (NonEmptyVector a) a Source # traverseLeftFrom :: Index (NonEmptyVector a) -> IndexedTraversal1' (Index (NonEmptyVector a)) (NonEmptyVector a) a Source # | |
HasDirectedTraversals v => HasDirectedTraversals (Cyclic v) Source # | |
Defined in HGeometry.Cyclic traverseRightFrom :: Index (Cyclic v a) -> IndexedTraversal1' (Index (Cyclic v a)) (Cyclic v a) a Source # traverseLeftFrom :: Index (Cyclic v a) -> IndexedTraversal1' (Index (Cyclic v a)) (Cyclic v a) a Source # |
class ShiftedEq t where Source #
Class for types that have an Equality test up to cyclic shifts
type ElemCyclic t Source #
The type of the elements stored in this cyclic container.
Instances
Foldable1 v => ShiftedEq (Cyclic v a) Source # | |||||
Defined in HGeometry.Cyclic
|