Class/Object

scalaz

Zipper

Related Docs: object Zipper | package scalaz

Permalink

final case class Zipper[+A](lefts: Stream[A], focus: A, rights: Stream[A]) extends Product with Serializable

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
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Zipper
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Zipper(lefts: Stream[A], focus: A, rights: Stream[A])

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def ap[B](f: ⇒ Zipper[(A) ⇒ B]): Zipper[B]

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def atEnd: Boolean

    Permalink

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

  7. def atStart: Boolean

    Permalink

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

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def delete: Option[Zipper[A]]

    Permalink

    An alias for deleteRight

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

    Permalink

    An alias for deleteRightC

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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 deleteOthers: Zipper[A]

    Permalink

    Deletes all elements except the focused element.

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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 end: Zipper[A]

    Permalink

    Moves focus to the end of the zipper.

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

    Permalink
    Definition Classes
    AnyRef
  22. def finalize(): Unit

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

  28. val focus: A

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

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

    Permalink
  31. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  32. def index: Int

    Permalink

    The index of the focus.

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

    Permalink

    An alias for insertRight

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

    Permalink

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

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

    Permalink

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

  36. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  37. val lefts: Stream[A]

    Permalink
  38. def length: Int

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

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

    Permalink

    Apply f to the focus and update with the result.

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

    Permalink

    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)

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

    Permalink

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

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

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

    Permalink

    Possibly moves to next element to the right of focus.

  45. def nextC: Zipper[A]

    Permalink

    Moves focus to the next element.

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

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

    Permalink

    Possibly moves to next element to the right of focus.

  47. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  48. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  49. def positions: Zipper[Zipper[A]]

    Permalink

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

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

    Permalink

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

  51. def previousC: Zipper[A]

    Permalink

    Moves focus to the previous element.

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

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

    Permalink

    Possibly moves to previous element to the left of focus.

  53. val rights: Stream[A]

    Permalink
  54. def start: Zipper[A]

    Permalink

    Moves focus to the start of the zipper.

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

    Permalink
    Definition Classes
    AnyRef
  56. def toStream: Stream[A]

    Permalink

    Get the Stream representation of this Zipper.

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

  57. def toString(): String

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

    Permalink
  59. def tryPrevious: Zipper[A]

    Permalink

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

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

    Permalink

    Update the focus in this zipper.

  61. final def wait(): Unit

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

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

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

    Permalink

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

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped