-
Undocumented
Declaration
Swift
public let left: [A] -
Undocumented
Declaration
Swift
public let focus: A -
Undocumented
Declaration
Swift
public let right: [A] -
Safe downcast.
Declaration
Swift
public static func fix(_ value: ZipperOf<A>) -> Zipper<A>Parameters
valueValue in the higher-kind form.
Return Value
Value cast to Zipper.
-
Initializes a Zipper.
Declaration
Swift
public init(left: [A], focus: A, right: [A])Parameters
leftElements to the left of the focus.
focusFocused element.
rightElements to the right of the focus.
-
Initializes a Zipper from a NonEmptyArray, focused on the head of the array.
Declaration
Swift
public init(fromNEA array: NonEmptyArray<A>)Parameters
arrayNonEmptyArray to initialize the Zipper.
-
Initializes a Zipper form an Array, focused on the head of the array. If the array is empty, the result will be nil.
Declaration
Swift
public convenience init?(fromArray array: [A])Parameters
arrayArray to initialize the Zipper.
-
Moves the focus one step to the left. If it is already in the leftmost position, it does nothing.
Declaration
Swift
public func moveLeft() -> Zipper<A>Return Value
A Zipper that is focused on one element to the left of the current focus.
-
Moves the focus one step to the right. If it is already in the rightmost position, it does nothing.
Declaration
Swift
public func moveRight() -> Zipper<A>Return Value
A Zipper that is focused on one element to the right of the current focus.
-
Moves the focus to the leftmost position.
Declaration
Swift
public func moveToFirst() -> Zipper<A>Return Value
A Zipper that is focused on the leftmost position.
-
Moves the focus to the rightmost position.
Declaration
Swift
public func moveToLast() -> Zipper<A>Return Value
A Zipper that is focused on the rightmost position.
-
Converts this Zipper to an Array.
Declaration
Swift
public func asArray() -> [A]Return Value
An array with the contents of this Zipper.
-
Checks if the focus is at the leftmost position.
Declaration
Swift
public func isBeginning() -> BoolReturn Value
True if the focus is at the leftmost position; false, otherwise.
-
Checks if the focus is at the rightmost position.
Declaration
Swift
public func isEnding() -> BoolReturn Value
True if the focus is at the rightmost position; false, otherwise.
-
Declaration
Swift
public var description: String { get }
Install in Dash
Zipper Class Reference