scalaz

Zipper

sealed trait Zipper[+A] extends AnyRef

Provides a pointed stream, which is a non-empty zipper-like stream structure that tracks an index (focus) position in a stream. Focus can be moved forward and backwards through the stream, elements can be inserted before or after the focused position, and the focused item can be deleted.

Based on the pointedlist library by Jeff Wheeler.

Source
Zipper.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Zipper
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract val focus: A

  2. abstract val lefts: Stream[A]

  3. abstract val rights: Stream[A]

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def ap[B](f: ⇒ Zipper[(A) ⇒ B]): Zipper[B]

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def atEnd: Boolean

    Whether the focus is on the last element in the zipper.

  9. def atStart: Boolean

    Whether the focus is on the first element in the zipper.

  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def copy[AA >: A](lefts: Stream[AA] = this.lefts, focus: AA = this.focus, rights: Stream[AA] = this.rights): Zipper[AA]

  12. def delete: Option[Zipper[A]]

    An alias for deleteRight

  13. def deleteC: Option[Zipper[A]]

    An alias for deleteRightC

  14. def deleteLeft: Option[Zipper[A]]

    Deletes the element at focus and moves the focus to the left.

    Deletes the element at focus and moves the focus to the left. If there is no element on the left, focus is moved to the right.

  15. def deleteLeftC: Option[Zipper[A]]

    Deletes the focused element and moves focus to the left.

    Deletes the focused element and moves focus to the left. If the focus was on the first element, focus is moved to the last element.

  16. def deleteLeftCOr[AA >: A](z: ⇒ Zipper[AA]): Zipper[AA]

    Deletes the focused element and moves focus to the left.

    Deletes the focused element and moves focus to the left. If the focus was on the first element, focus is moved to the last element.

  17. def deleteLeftOr[AA >: A](z: ⇒ Zipper[AA]): Zipper[AA]

    Deletes the element at focus and moves the focus to the left.

    Deletes the element at focus and moves the focus to the left. If there is no element on the left, focus is moved to the right.

  18. def deleteOthers: Zipper[A]

    Deletes all elements except the focused element.

  19. def deleteRight: Option[Zipper[A]]

    Deletes the element at focus and moves the focus to the right.

    Deletes the element at focus and moves the focus to the right. If there is no element on the right, focus is moved to the left.

  20. def deleteRightC: Option[Zipper[A]]

    Deletes the focused element and moves focus to the right.

    Deletes the focused element and moves focus to the right. If the focus was on the last element, focus is moved to the first element.

  21. def deleteRightCOr[AA >: A](z: ⇒ Zipper[AA]): Zipper[AA]

    Deletes the focused element and moves focus to the right.

    Deletes the focused element and moves focus to the right. If the focus was on the last element, focus is moved to the first element.

  22. def deleteRightOr[AA >: A](z: ⇒ Zipper[AA]): Zipper[AA]

    Deletes the element at focus and moves the focus to the right.

    Deletes the element at focus and moves the focus to the right. If there is no element on the right, focus is moved to the left.

  23. def end: Zipper[A]

    Moves focus to the end of the zipper.

  24. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  26. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  27. def findBy[AA >: A](f: (Zipper[AA]) ⇒ Option[Zipper[AA]])(p: (AA) ⇒ Boolean): Option[Zipper[AA]]

    Given a traversal function, find the first element along the traversal that matches a given predicate.

  28. def findNext(p: (A) ⇒ Boolean): Option[Zipper[A]]

    Moves focus to the nearest element on the right that matches the given predicate, or None if there is no such element.

  29. def findPrevious(p: (A) ⇒ Boolean): Option[Zipper[A]]

    Moves focus to the previous element on the left that matches the given predicate, or None if there is no such element.

  30. def findZ(p: (A) ⇒ Boolean): Option[Zipper[A]]

    Moves focus to the nearest element matching the given predicate, preferring the left, or None if no element matches.

  31. def findZor[AA >: A](p: (A) ⇒ Boolean, z: ⇒ Zipper[AA]): Zipper[AA]

    Moves focus to the nearest element matching the given predicate, preferring the left, or the default if no element matches.

  32. def foldLeft[B](b: B)(f: (B, A) ⇒ B): B

  33. def foldRight[B](b: ⇒ B)(f: (A, ⇒ B) ⇒ B): B

  34. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  35. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  36. def index: Int

    The index of the focus.

  37. def insert[AA >: A]: (AA) ⇒ Zipper[AA]

    An alias for insertRight

  38. def insertLeft[AA >: A](y: AA): Zipper[AA]

    Inserts an element to the left of focus and focuses on the new element.

  39. def insertRight[AA >: A](y: AA): Zipper[AA]

    Inserts an element to the right of focus and focuses on the new element.

  40. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  41. def length: Int

  42. def map[B](f: (A) ⇒ B): Zipper[B]

  43. def modify[AA >: A](f: (A) ⇒ AA): Zipper[AA]

    Apply f to the focus and update with the result.

  44. def move(n: Int): Option[Zipper[A]]

    Moves focus n elements in the zipper, or None if there is no such element.

    Moves focus n elements in the zipper, or None if there is no such element.

    n

    number of elements to move (positive is forward, negative is backwards)

  45. def moveOr[AA >: A](n: Int, z: ⇒ Zipper[AA]): Zipper[AA]

    Moves focus to the nth element of the zipper, or the default if there is no such element.

  46. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  47. def next: Option[Zipper[A]]

    Possibly moves to next element to the right of focus.

  48. def nextC: Zipper[A]

    Moves focus to the next element.

    Moves focus to the next element. If the last element is currently focused, loop to the first element.

  49. def nextOr[AA >: A](z: ⇒ Zipper[AA]): Zipper[AA]

    Possibly moves to next element to the right of focus.

  50. final def notify(): Unit

    Definition Classes
    AnyRef
  51. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  52. def positions: Zipper[Zipper[A]]

    A zipper of all positions of the zipper, with focus on the current position.

  53. def previous: Option[Zipper[A]]

    Possibly moves to the previous element to the left of focus.

  54. def previousC: Zipper[A]

    Moves focus to the previous element.

    Moves focus to the previous element. If the first element is currently focused, loop to the last element.

  55. def previousOr[AA >: A](z: ⇒ Zipper[AA]): Zipper[AA]

    Possibly moves to previous element to the left of focus.

  56. def start: Zipper[A]

    Moves focus to the start of the zipper.

  57. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  58. def toStream: Stream[A]

    Get the Stream representation of this Zipper.

    Get the Stream representation of this Zipper. This fully traverses lefts. rights is not evaluated.

  59. def toString(): String

    Definition Classes
    Zipper → AnyRef → Any
  60. def traverse[G[_], B](f: (A) ⇒ G[B])(implicit arg0: Applicative[G]): G[Zipper[B]]

  61. def tryNext: Zipper[A]

    Moves to the next element to the right of focus, or error if there is no element on the right.

  62. def tryPrevious: Zipper[A]

    Moves to the previous element to the left of focus, or error if there is no element on the left.

  63. def update[AA >: A](focus: AA): Zipper[AA]

    Update the focus in this zipper.

  64. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  66. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  67. def withFocus: Zipper[(A, Boolean)]

    Pairs each element with a boolean indicating whether that element has focus.

Inherited from AnyRef

Inherited from Any

Ungrouped