public func empty<T>() : DoublyLinkedList<T>
Create an empty DoublyLinkedList
public func prepend<T>(x : T, l : DoublyLinkedList<T>) : DoublyLinkedList<T>
Prepend an element to a DoublyLinkedList, mutating the underlying DoublyLinkedList. Returns the new DoublyLinkedList
public func append<T>(l : DoublyLinkedList<T>, x : T) : DoublyLinkedList<T>
Append an element to a DoublyLinkedList, mutating the underlying DoublyLinkedList. Returns the new DoublyLinkedList
public func popHead<T>(l : DoublyLinkedList<T>) : (DoublyLinkedList<T>, ?T)
Pops the head element of the DoublyLinkedList, mutating the underlying DoublyLinkedList and returning both the new DoublyLinkedList and the popped element (if exists)
public func popTail<T>(l : DoublyLinkedList<T>) : (DoublyLinkedList<T>, ?T)
Pops the tail element of the DoublyLinkedList, mutating the underlying DoublyLinkedList and returning both the new DoublyLinkedList and the popped element (if exists)
public func merge<T>(l1 : DoublyLinkedList<T>, l2 : DoublyLinkedList<T>) : DoublyLinkedList<T>
Merge two DoublyLinkedLists, mutating the underlying DoublyLinkedList arguments passed in. Returns the merged DoublyLinkedLists
public func equal<T>(
l1 : DoublyLinkedList<T>,
l2 : DoublyLinkedList<T>,
equal : (T, T) -> Bool
) : Bool
Takes in two DoublyLinkedLists and a user defined equivalence function for each element of the DoublyLinkedList. Returns a boolean
public func toText<T>(ll : DoublyLinkedList<T>, toText : T -> Text) : Text
For Debugging: Takes in a DoublyLinkedList and toText function, and returns a textual representation of the DoublyLinkedList